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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a97f0338
Commit
a97f0338
authored
Oct 11, 2011
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
6e2aeb95
d31d7ea6
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
2591 deletions
+61
-2591
mysql-test/r/subselect_sj2.result
mysql-test/r/subselect_sj2.result
+20
-0
mysql-test/r/subselect_sj2_jcl6.result
mysql-test/r/subselect_sj2_jcl6.result
+20
-0
mysql-test/r/subselect_sj2_mat.result
mysql-test/r/subselect_sj2_mat.result
+0
-821
mysql-test/r/subselect_sj_mat.result
mysql-test/r/subselect_sj_mat.result
+0
-1769
mysql-test/t/subselect_sj2.test
mysql-test/t/subselect_sj2.test
+20
-0
sql/sql_select.cc
sql/sql_select.cc
+1
-1
No files found.
mysql-test/r/subselect_sj2.result
View file @
a97f0338
...
...
@@ -802,4 +802,24 @@ WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1
f12
y
DROP TABLE t1,t2,t3;
#
# BUG#869012: Wrong result with semijoin + materialization + AND in WHERE
#
CREATE TABLE t1 (f3 varchar(1) , f4 varchar(1) ) engine=InnoDB;
INSERT IGNORE INTO t1 VALUES ('x','x'),('x','x');
CREATE TABLE t2 ( f4 varchar(1) ) ;
INSERT IGNORE INTO t2 VALUES ('g');
CREATE TABLE t3 (f4 varchar(1) ) Engine=InnoDB;
INSERT IGNORE INTO t3 VALUES ('x');
set @tmp_869012=@@optimizer_switch;
SET optimizer_switch='semijoin=on,materialization=on';
SELECT *
FROM t1 , t2
WHERE ( t1.f4 ) IN ( SELECT f4 FROM t3 )
AND t2.f4 != t1.f3 ;
f3 f4 f4
x x g
x x g
set optimizer_switch= @tmp_869012;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
mysql-test/r/subselect_sj2_jcl6.result
View file @
a97f0338
...
...
@@ -813,6 +813,26 @@ WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1
f12
y
DROP TABLE t1,t2,t3;
#
# BUG#869012: Wrong result with semijoin + materialization + AND in WHERE
#
CREATE TABLE t1 (f3 varchar(1) , f4 varchar(1) ) engine=InnoDB;
INSERT IGNORE INTO t1 VALUES ('x','x'),('x','x');
CREATE TABLE t2 ( f4 varchar(1) ) ;
INSERT IGNORE INTO t2 VALUES ('g');
CREATE TABLE t3 (f4 varchar(1) ) Engine=InnoDB;
INSERT IGNORE INTO t3 VALUES ('x');
set @tmp_869012=@@optimizer_switch;
SET optimizer_switch='semijoin=on,materialization=on';
SELECT *
FROM t1 , t2
WHERE ( t1.f4 ) IN ( SELECT f4 FROM t3 )
AND t2.f4 != t1.f3 ;
f3 f4 f4
x x g
x x g
set optimizer_switch= @tmp_869012;
# This must be the last in the file:
set optimizer_switch=@subselect_sj2_tmp;
set join_cache_level=default;
show variables like 'join_cache_level';
...
...
mysql-test/r/subselect_sj2_mat.result
deleted
100644 → 0
View file @
6e2aeb95
This diff is collapsed.
Click to expand it.
mysql-test/r/subselect_sj_mat.result
deleted
100644 → 0
View file @
6e2aeb95
This diff is collapsed.
Click to expand it.
mysql-test/t/subselect_sj2.test
View file @
a97f0338
...
...
@@ -988,5 +988,25 @@ WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1
DROP
TABLE
t1
,
t2
,
t3
;
--
echo
#
--
echo
# BUG#869012: Wrong result with semijoin + materialization + AND in WHERE
--
echo
#
CREATE
TABLE
t1
(
f3
varchar
(
1
)
,
f4
varchar
(
1
)
)
engine
=
InnoDB
;
INSERT
IGNORE
INTO
t1
VALUES
(
'x'
,
'x'
),(
'x'
,
'x'
);
CREATE
TABLE
t2
(
f4
varchar
(
1
)
)
;
INSERT
IGNORE
INTO
t2
VALUES
(
'g'
);
CREATE
TABLE
t3
(
f4
varchar
(
1
)
)
Engine
=
InnoDB
;
INSERT
IGNORE
INTO
t3
VALUES
(
'x'
);
set
@
tmp_869012
=@@
optimizer_switch
;
SET
optimizer_switch
=
'semijoin=on,materialization=on'
;
SELECT
*
FROM
t1
,
t2
WHERE
(
t1
.
f4
)
IN
(
SELECT
f4
FROM
t3
)
AND
t2
.
f4
!=
t1
.
f3
;
set
optimizer_switch
=
@
tmp_869012
;
--
echo
# This must be the last in the file:
set
optimizer_switch
=@
subselect_sj2_tmp
;
sql/sql_select.cc
View file @
a97f0338
...
...
@@ -7969,7 +7969,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
*/
JOIN_TAB
*
first_inner_tab
=
tab
->
first_inner
;
if
(
tab
->
table
)
if
(
!
tab
->
bush_children
)
current_map
=
tab
->
table
->
map
;
else
current_map
=
tab
->
bush_children
->
start
->
emb_sj_nest
->
sj_inner_tables
;
...
...
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