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
eb88c905
Commit
eb88c905
authored
Jan 23, 2014
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
2ff76f67
f0fa66a2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
1 deletion
+57
-1
mysql-test/r/subselect_mat.result
mysql-test/r/subselect_mat.result
+18
-0
mysql-test/r/subselect_sj_mat.result
mysql-test/r/subselect_sj_mat.result
+18
-0
mysql-test/t/subselect_sj_mat.test
mysql-test/t/subselect_sj_mat.test
+20
-0
sql/opt_subselect.cc
sql/opt_subselect.cc
+1
-1
No files found.
mysql-test/r/subselect_mat.result
View file @
eb88c905
...
@@ -2058,6 +2058,24 @@ CA ML CA ML
...
@@ -2058,6 +2058,24 @@ CA ML CA ML
CA ML RO ML
CA ML RO ML
DROP TABLE t1,t2;
DROP TABLE t1,t2;
set join_cache_level=@tmp_mdev5056;
set join_cache_level=@tmp_mdev5056;
#
# MDEV-5368: Server crashes in Item_in_subselect::optimize on 2nd
# execution of PS with IN subqueries, materialization+semijoin
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(3);
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM t2;
INSERT INTO t2 VALUES (8),(9);
PREPARE stmt FROM "
SELECT * FROM t1 WHERE 1 IN ( SELECT b FROM v2 WHERE 2 IN ( SELECT MAX(a) FROM t1 ) )
";
EXECUTE stmt;
a
EXECUTE stmt;
a
DROP TABLE t1, t2;
DROP VIEW v2;
# End of 5.5 tests
# End of 5.5 tests
set @subselect_mat_test_optimizer_switch_value=null;
set @subselect_mat_test_optimizer_switch_value=null;
set @@optimizer_switch='materialization=on,in_to_exists=off,semijoin=off';
set @@optimizer_switch='materialization=on,in_to_exists=off,semijoin=off';
...
...
mysql-test/r/subselect_sj_mat.result
View file @
eb88c905
...
@@ -2098,4 +2098,22 @@ CA ML CA ML
...
@@ -2098,4 +2098,22 @@ CA ML CA ML
CA ML RO ML
CA ML RO ML
DROP TABLE t1,t2;
DROP TABLE t1,t2;
set join_cache_level=@tmp_mdev5056;
set join_cache_level=@tmp_mdev5056;
#
# MDEV-5368: Server crashes in Item_in_subselect::optimize on 2nd
# execution of PS with IN subqueries, materialization+semijoin
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(3);
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM t2;
INSERT INTO t2 VALUES (8),(9);
PREPARE stmt FROM "
SELECT * FROM t1 WHERE 1 IN ( SELECT b FROM v2 WHERE 2 IN ( SELECT MAX(a) FROM t1 ) )
";
EXECUTE stmt;
a
EXECUTE stmt;
a
DROP TABLE t1, t2;
DROP VIEW v2;
# End of 5.5 tests
# End of 5.5 tests
mysql-test/t/subselect_sj_mat.test
View file @
eb88c905
...
@@ -1750,5 +1750,25 @@ WHERE ( alias2.c2, alias1.c1 ) IN ( SELECT c4, c3 FROM t2 ) AND alias1.c1 IN ( S
...
@@ -1750,5 +1750,25 @@ WHERE ( alias2.c2, alias1.c1 ) IN ( SELECT c4, c3 FROM t2 ) AND alias1.c1 IN ( S
DROP
TABLE
t1
,
t2
;
DROP
TABLE
t1
,
t2
;
set
join_cache_level
=@
tmp_mdev5056
;
set
join_cache_level
=@
tmp_mdev5056
;
--
echo
#
--
echo
# MDEV-5368: Server crashes in Item_in_subselect::optimize on 2nd
--
echo
# execution of PS with IN subqueries, materialization+semijoin
--
echo
#
CREATE
TABLE
t1
(
a
INT
)
ENGINE
=
MyISAM
;
INSERT
INTO
t1
VALUES
(
1
),(
3
);
CREATE
TABLE
t2
(
b
INT
)
ENGINE
=
MyISAM
;
CREATE
ALGORITHM
=
MERGE
VIEW
v2
AS
SELECT
*
FROM
t2
;
INSERT
INTO
t2
VALUES
(
8
),(
9
);
PREPARE
stmt
FROM
"
SELECT * FROM t1 WHERE 1 IN ( SELECT b FROM v2 WHERE 2 IN ( SELECT MAX(a) FROM t1 ) )
"
;
EXECUTE
stmt
;
EXECUTE
stmt
;
DROP
TABLE
t1
,
t2
;
DROP
VIEW
v2
;
--
echo
# End of 5.5 tests
--
echo
# End of 5.5 tests
sql/opt_subselect.cc
View file @
eb88c905
...
@@ -1525,7 +1525,7 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
...
@@ -1525,7 +1525,7 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
for
(
tl
=
(
TABLE_LIST
*
)(
parent_lex
->
table_list
.
first
);
tl
->
next_local
;
tl
=
tl
->
next_local
)
for
(
tl
=
(
TABLE_LIST
*
)(
parent_lex
->
table_list
.
first
);
tl
->
next_local
;
tl
=
tl
->
next_local
)
{}
{}
tl
->
next_local
=
subq_lex
->
leaf_tables
.
head
()
;
tl
->
next_local
=
subq_lex
->
join
->
tables_list
;
/* A theory: no need to re-connect the next_global chain */
/* A theory: no need to re-connect the next_global chain */
...
...
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