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
9a630ad2
Commit
9a630ad2
authored
Sep 29, 2011
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
273d1b93
134e4178
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
1 deletion
+87
-1
mysql-test/r/subselect_mat.result
mysql-test/r/subselect_mat.result
+28
-0
mysql-test/r/subselect_sj_mat.result
mysql-test/r/subselect_sj_mat.result
+28
-0
mysql-test/t/subselect_sj_mat.test
mysql-test/t/subselect_sj_mat.test
+29
-0
sql/sql_select.cc
sql/sql_select.cc
+2
-1
No files found.
mysql-test/r/subselect_mat.result
View file @
9a630ad2
...
...
@@ -1675,6 +1675,34 @@ GROUP BY t4.f6);
f4
DROP TABLE t1,t3,t4;
set optimizer_switch=@tmp_860300;
#
# BUG#860535: Assertion `keypart_map' failed in mi_rkey with semijoin
#
set @tmp_860535=@@optimizer_switch;
set optimizer_switch='semijoin=on,materialization=on,loosescan=off,firstmatch=off';
CREATE TABLE t1 (f3 int) ;
INSERT INTO t1 VALUES (1),(7);
CREATE TABLE t2 (f3 int , f5 varchar(1), KEY (f3)) ;
INSERT INTO t2 VALUES (7,'b');
CREATE TABLE t3 (f3 int , f4 varchar(1) , KEY(f3), KEY (f4,f3)) ;
INSERT INTO t3 VALUES (1,'t'),(7,'g');
CREATE TABLE t4
SELECT f3
FROM t1 WHERE ( f3 ) NOT IN (
SELECT f3
FROM t2
WHERE f5 IN (
SELECT f4
FROM t3
WHERE t3.f3 < 3
)
);
SELECT * FROM t4;
f3
1
7
DROP TABLE t1, t2, t3, t4;
set optimizer_switch=@tmp_860535;
set @subselect_mat_test_optimizer_switch_value=null;
set @@optimizer_switch='materialization=on,in_to_exists=off,semijoin=off';
set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on';
...
...
mysql-test/r/subselect_sj_mat.result
View file @
9a630ad2
...
...
@@ -1715,3 +1715,31 @@ GROUP BY t4.f6);
f4
DROP TABLE t1,t3,t4;
set optimizer_switch=@tmp_860300;
#
# BUG#860535: Assertion `keypart_map' failed in mi_rkey with semijoin
#
set @tmp_860535=@@optimizer_switch;
set optimizer_switch='semijoin=on,materialization=on,loosescan=off,firstmatch=off';
CREATE TABLE t1 (f3 int) ;
INSERT INTO t1 VALUES (1),(7);
CREATE TABLE t2 (f3 int , f5 varchar(1), KEY (f3)) ;
INSERT INTO t2 VALUES (7,'b');
CREATE TABLE t3 (f3 int , f4 varchar(1) , KEY(f3), KEY (f4,f3)) ;
INSERT INTO t3 VALUES (1,'t'),(7,'g');
CREATE TABLE t4
SELECT f3
FROM t1 WHERE ( f3 ) NOT IN (
SELECT f3
FROM t2
WHERE f5 IN (
SELECT f4
FROM t3
WHERE t3.f3 < 3
)
);
SELECT * FROM t4;
f3
1
7
DROP TABLE t1, t2, t3, t4;
set optimizer_switch=@tmp_860535;
mysql-test/t/subselect_sj_mat.test
View file @
9a630ad2
...
...
@@ -1370,3 +1370,32 @@ WHERE 'h' IN (SELECT f6
DROP
TABLE
t1
,
t3
,
t4
;
set
optimizer_switch
=@
tmp_860300
;
--
echo
#
--
echo
# BUG#860535: Assertion `keypart_map' failed in mi_rkey with semijoin
--
echo
#
set
@
tmp_860535
=@@
optimizer_switch
;
set
optimizer_switch
=
'semijoin=on,materialization=on,loosescan=off,firstmatch=off'
;
CREATE
TABLE
t1
(
f3
int
)
;
INSERT
INTO
t1
VALUES
(
1
),(
7
);
CREATE
TABLE
t2
(
f3
int
,
f5
varchar
(
1
),
KEY
(
f3
))
;
INSERT
INTO
t2
VALUES
(
7
,
'b'
);
CREATE
TABLE
t3
(
f3
int
,
f4
varchar
(
1
)
,
KEY
(
f3
),
KEY
(
f4
,
f3
))
;
INSERT
INTO
t3
VALUES
(
1
,
't'
),(
7
,
'g'
);
CREATE
TABLE
t4
SELECT
f3
FROM
t1
WHERE
(
f3
)
NOT
IN
(
SELECT
f3
FROM
t2
WHERE
f5
IN
(
SELECT
f4
FROM
t3
WHERE
t3
.
f3
<
3
)
);
SELECT
*
FROM
t4
;
DROP
TABLE
t1
,
t2
,
t3
,
t4
;
set
optimizer_switch
=@
tmp_860535
;
sql/sql_select.cc
View file @
9a630ad2
...
...
@@ -7239,7 +7239,8 @@ static bool are_tables_local(JOIN_TAB *jtab, table_map used_tables)
except the const tables.
*/
table_map
local_tables
=
jtab
->
emb_sj_nest
->
nested_join
->
used_tables
|
jtab
->
join
->
const_table_map
;
jtab
->
join
->
const_table_map
|
OUTER_REF_TABLE_BIT
;
return
!
test
(
used_tables
&
~
local_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