Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
67e5b794
Commit
67e5b794
authored
Jul 16, 2013
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge
parents
5c0fa3ad
947c2bdb
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
96 additions
and
1 deletion
+96
-1
mysql-test/r/subselect_sj2.result
mysql-test/r/subselect_sj2.result
+22
-0
mysql-test/r/subselect_sj2_jcl6.result
mysql-test/r/subselect_sj2_jcl6.result
+22
-0
mysql-test/r/subselect_sj2_mat.result
mysql-test/r/subselect_sj2_mat.result
+22
-0
mysql-test/t/subselect_sj2.test
mysql-test/t/subselect_sj2.test
+29
-0
sql/sql_select.cc
sql/sql_select.cc
+1
-1
No files found.
mysql-test/r/subselect_sj2.result
View file @
67e5b794
...
...
@@ -1094,5 +1094,27 @@ COUNT(*)
3724
set optimizer_prune_level=@tmp_951283;
DROP TABLE t1,t2;
DROP TABLE IF EXISTS t1,t2,t3,t4;
#
# MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin
#
CREATE TABLE t1 ( t1_pk1 varchar(3), t1_pk2 varchar(52), PRIMARY KEY (t1_pk1,t1_pk2)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('CHN','Chinese'),('USA','English');
CREATE TABLE t2 ( t2_i int(11), t2_c varchar(52)) ENGINE=InnoDB;
INSERT INTO t2 VALUES (86,'English');
CREATE TABLE t3 ( t3_i int(11), t3_c varchar(35)) ENGINE=InnoDB;
INSERT INTO t3 VALUES (3989,'Abilene'),(3873,'Akron');
create table t4 like t1;
insert into t4 select * from t1;
SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
t1_pk1 t1_pk2 t3_i t3_c
explain
SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where; Using index
1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Start temporary
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
1 PRIMARY t4 index NULL PRIMARY 59 NULL 2 Using where; Using index; End temporary
DROP TABLE t1,t2,t3,t4;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
mysql-test/r/subselect_sj2_jcl6.result
View file @
67e5b794
...
...
@@ -1109,6 +1109,28 @@ COUNT(*)
3724
set optimizer_prune_level=@tmp_951283;
DROP TABLE t1,t2;
DROP TABLE IF EXISTS t1,t2,t3,t4;
#
# MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin
#
CREATE TABLE t1 ( t1_pk1 varchar(3), t1_pk2 varchar(52), PRIMARY KEY (t1_pk1,t1_pk2)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('CHN','Chinese'),('USA','English');
CREATE TABLE t2 ( t2_i int(11), t2_c varchar(52)) ENGINE=InnoDB;
INSERT INTO t2 VALUES (86,'English');
CREATE TABLE t3 ( t3_i int(11), t3_c varchar(35)) ENGINE=InnoDB;
INSERT INTO t3 VALUES (3989,'Abilene'),(3873,'Akron');
create table t4 like t1;
insert into t4 select * from t1;
SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
t1_pk1 t1_pk2 t3_i t3_c
explain
SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where; Using index
1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Start temporary; Using join buffer (flat, BNL join)
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
1 PRIMARY t4 hash_index NULL #hash#$hj:PRIMARY 55:59 test.t3.t3_c 2 Using where; End temporary; Using join buffer (incremental, BNLH join)
DROP TABLE t1,t2,t3,t4;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
#
...
...
mysql-test/r/subselect_sj2_mat.result
View file @
67e5b794
...
...
@@ -1096,6 +1096,28 @@ COUNT(*)
3724
set optimizer_prune_level=@tmp_951283;
DROP TABLE t1,t2;
DROP TABLE IF EXISTS t1,t2,t3,t4;
#
# MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin
#
CREATE TABLE t1 ( t1_pk1 varchar(3), t1_pk2 varchar(52), PRIMARY KEY (t1_pk1,t1_pk2)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('CHN','Chinese'),('USA','English');
CREATE TABLE t2 ( t2_i int(11), t2_c varchar(52)) ENGINE=InnoDB;
INSERT INTO t2 VALUES (86,'English');
CREATE TABLE t3 ( t3_i int(11), t3_c varchar(35)) ENGINE=InnoDB;
INSERT INTO t3 VALUES (3989,'Abilene'),(3873,'Akron');
create table t4 like t1;
insert into t4 select * from t1;
SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
t1_pk1 t1_pk2 t3_i t3_c
explain
SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where; Using index
1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Start temporary
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
1 PRIMARY t4 index NULL PRIMARY 59 NULL 2 Using where; Using index; End temporary
DROP TABLE t1,t2,t3,t4;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
set optimizer_switch=default;
...
...
mysql-test/t/subselect_sj2.test
View file @
67e5b794
...
...
@@ -1225,5 +1225,34 @@ WHERE alias3.d IN (
set
optimizer_prune_level
=@
tmp_951283
;
DROP
TABLE
t1
,
t2
;
--
source
include
/
have_innodb
.
inc
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
,
t2
,
t3
,
t4
;
--
enable_warnings
--
echo
#
--
echo
# MDEV-4782: Valgrind warnings (Conditional jump or move depends on uninitialised value) with InnoDB, semijoin
--
echo
#
CREATE
TABLE
t1
(
t1_pk1
varchar
(
3
),
t1_pk2
varchar
(
52
),
PRIMARY
KEY
(
t1_pk1
,
t1_pk2
))
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
'CHN'
,
'Chinese'
),(
'USA'
,
'English'
);
CREATE
TABLE
t2
(
t2_i
int
(
11
),
t2_c
varchar
(
52
))
ENGINE
=
InnoDB
;
INSERT
INTO
t2
VALUES
(
86
,
'English'
);
CREATE
TABLE
t3
(
t3_i
int
(
11
),
t3_c
varchar
(
35
))
ENGINE
=
InnoDB
;
INSERT
INTO
t3
VALUES
(
3989
,
'Abilene'
),(
3873
,
'Akron'
);
create
table
t4
like
t1
;
insert
into
t4
select
*
from
t1
;
SELECT
*
FROM
t1
,
t3
WHERE
t3_c
IN
(
SELECT
t1_pk2
FROM
t4
,
t2
WHERE
t2_c
=
t1_pk2
AND
t2_i
>=
t3_i
)
AND
(
t1_pk1
=
'POL'
);
explain
SELECT
*
FROM
t1
,
t3
WHERE
t3_c
IN
(
SELECT
t1_pk2
FROM
t4
,
t2
WHERE
t2_c
=
t1_pk2
AND
t2_i
>=
t3_i
)
AND
(
t1_pk1
=
'POL'
);
DROP
TABLE
t1
,
t2
,
t3
,
t4
;
--
echo
# This must be the last in the file:
set
optimizer_switch
=@
subselect_sj2_tmp
;
sql/sql_select.cc
View file @
67e5b794
...
...
@@ -16326,7 +16326,7 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
if
(
rc
!=
NESTED_LOOP_NO_MORE_ROWS
)
{
error
=
(
*
join_tab
->
read_first_record
)(
join_tab
);
if
(
join_tab
->
keep_current_rowid
)
if
(
!
error
&&
join_tab
->
keep_current_rowid
)
join_tab
->
table
->
file
->
position
(
join_tab
->
table
->
record
[
0
]);
rc
=
evaluate_join_record
(
join
,
join_tab
,
error
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment