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
e1923e7f
Commit
e1923e7f
authored
Sep 28, 2011
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
555a1214
bccfb3d2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
1 deletion
+62
-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
+19
-0
sql/item_subselect.cc
sql/item_subselect.cc
+7
-1
No files found.
mysql-test/r/subselect_mat.result
View file @
e1923e7f
...
...
@@ -1657,6 +1657,24 @@ a
0
DROP TABLE t2,t3,t4,t5;
set optimizer_switch=@subselect_sj_mat_tmp;
#
# BUG#860300: Second crash with get_fanout_with_deps() with semijoin + materialization
#
set @tmp_860300=@@optimizer_switch;
set optimizer_switch='semijoin=on,materialization=on,loosescan=off,firstmatch=off';
CREATE TABLE t1 (f2 int);
INSERT INTO t1 VALUES (9),(6);
CREATE TABLE t3 (f4 int);
CREATE TABLE t4 (f6 varchar(1));
SELECT *
FROM t3
WHERE 'h' IN (SELECT f6
FROM t4
WHERE 5 IN (SELECT f2 FROM t1)
GROUP BY t4.f6);
f4
DROP TABLE t1,t3,t4;
set optimizer_switch=@tmp_860300;
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 @
e1923e7f
...
...
@@ -1697,3 +1697,21 @@ a
0
DROP TABLE t2,t3,t4,t5;
set optimizer_switch=@subselect_sj_mat_tmp;
#
# BUG#860300: Second crash with get_fanout_with_deps() with semijoin + materialization
#
set @tmp_860300=@@optimizer_switch;
set optimizer_switch='semijoin=on,materialization=on,loosescan=off,firstmatch=off';
CREATE TABLE t1 (f2 int);
INSERT INTO t1 VALUES (9),(6);
CREATE TABLE t3 (f4 int);
CREATE TABLE t4 (f6 varchar(1));
SELECT *
FROM t3
WHERE 'h' IN (SELECT f6
FROM t4
WHERE 5 IN (SELECT f2 FROM t1)
GROUP BY t4.f6);
f4
DROP TABLE t1,t3,t4;
set optimizer_switch=@tmp_860300;
mysql-test/t/subselect_sj_mat.test
View file @
e1923e7f
...
...
@@ -1351,3 +1351,22 @@ DROP TABLE t2,t3,t4,t5;
set
optimizer_switch
=@
subselect_sj_mat_tmp
;
--
echo
#
--
echo
# BUG#860300: Second crash with get_fanout_with_deps() with semijoin + materialization
--
echo
#
set
@
tmp_860300
=@@
optimizer_switch
;
set
optimizer_switch
=
'semijoin=on,materialization=on,loosescan=off,firstmatch=off'
;
CREATE
TABLE
t1
(
f2
int
);
INSERT
INTO
t1
VALUES
(
9
),(
6
);
CREATE
TABLE
t3
(
f4
int
);
CREATE
TABLE
t4
(
f6
varchar
(
1
));
SELECT
*
FROM
t3
WHERE
'h'
IN
(
SELECT
f6
FROM
t4
WHERE
5
IN
(
SELECT
f2
FROM
t1
)
GROUP
BY
t4
.
f6
);
DROP
TABLE
t1
,
t3
,
t4
;
set
optimizer_switch
=@
tmp_860300
;
sql/item_subselect.cc
View file @
e1923e7f
...
...
@@ -4394,7 +4394,13 @@ double get_fanout_with_deps(JOIN *join, table_map tset)
for
(
JOIN_TAB
*
tab
=
first_top_level_tab
(
join
,
WITHOUT_CONST_TABLES
);
tab
;
tab
=
next_top_level_tab
(
join
,
tab
))
{
if
((
tab
->
table
->
map
&
checked_deps
)
&&
!
tab
->
emb_sj_nest
&&
/*
Ignore SJM nests. They have tab->table==NULL. There is no point to walk
inside them, because GROUP BY clause cannot refer to tables from within
subquery.
*/
if
(
!
tab
->
is_sjm_nest
()
&&
(
tab
->
table
->
map
&
checked_deps
)
&&
!
tab
->
emb_sj_nest
&&
tab
->
records_read
!=
0
)
{
fanout
*=
rows2double
(
tab
->
records_read
);
...
...
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