Skip to content
Permalink
Browse files

MDEV-7565: Server crash with Signal 6 (part 2)

Preparation of subselect moved earlier (before checks which needs it prepared).
  • Loading branch information...
Oleksandr Byelkin
Oleksandr Byelkin committed Apr 23, 2015
1 parent 006acf7 commit 7ccde2cbd55814d6f8525552d27674a5d1f577bf
@@ -7015,3 +7015,15 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1));
exists(select 1 from t1 group by `c` in (select `c` from t1))
0
drop table t1;
#
# MDEV-7565: Server crash with Signal 6 (part 2)
#
Select
(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
) As `ControlRev`
From
(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
Group By TestCase.Revenue, TestCase.TemplateID;
ControlRev
NULL
@@ -7012,6 +7012,18 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1));
exists(select 1 from t1 group by `c` in (select `c` from t1))
0
drop table t1;
#
# MDEV-7565: Server crash with Signal 6 (part 2)
#
Select
(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
) As `ControlRev`
From
(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
Group By TestCase.Revenue, TestCase.TemplateID;
ControlRev
NULL
set optimizer_switch=default;
select @@optimizer_switch like '%materialization=on%';
@@optimizer_switch like '%materialization=on%'
@@ -7010,4 +7010,16 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1));
exists(select 1 from t1 group by `c` in (select `c` from t1))
0
drop table t1;
#
# MDEV-7565: Server crash with Signal 6 (part 2)
#
Select
(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
) As `ControlRev`
From
(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
Group By TestCase.Revenue, TestCase.TemplateID;
ControlRev
NULL
set @optimizer_switch_for_subselect_test=null;
@@ -7021,6 +7021,18 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1));
exists(select 1 from t1 group by `c` in (select `c` from t1))
0
drop table t1;
#
# MDEV-7565: Server crash with Signal 6 (part 2)
#
Select
(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
) As `ControlRev`
From
(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
Group By TestCase.Revenue, TestCase.TemplateID;
ControlRev
NULL
set optimizer_switch=default;
select @@optimizer_switch like '%subquery_cache=on%';
@@optimizer_switch like '%subquery_cache=on%'
@@ -7010,5 +7010,17 @@ select exists(select 1 from t1 group by `c` in (select `c` from t1));
exists(select 1 from t1 group by `c` in (select `c` from t1))
0
drop table t1;
#
# MDEV-7565: Server crash with Signal 6 (part 2)
#
Select
(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
) As `ControlRev`
From
(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
Group By TestCase.Revenue, TestCase.TemplateID;
ControlRev
NULL
set @optimizer_switch_for_subselect_test=null;
set @join_cache_level_for_subselect_test=NULL;
@@ -5890,3 +5890,15 @@ DROP TABLE t1,t2;
create table t1 (c int);
select exists(select 1 from t1 group by `c` in (select `c` from t1));
drop table t1;

--echo #
--echo # MDEV-7565: Server crash with Signal 6 (part 2)
--echo #
Select
(Select Sum(`TestCase`.Revenue) From mysql.slow_log E
Where TestCase.TemplateID not in (Select 1 from mysql.slow_log where 2=2)
) As `ControlRev`
From
(Select 3 as Revenue, 4 as TemplateID) As `TestCase`
Group By TestCase.Revenue, TestCase.TemplateID;

@@ -703,6 +703,12 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
if (!optimizer_flag(thd, OPTIMIZER_SWITCH_IN_TO_EXISTS) &&
!optimizer_flag(thd, OPTIMIZER_SWITCH_MATERIALIZATION))
my_error(ER_ILLEGAL_SUBQUERY_OPTIMIZER_SWITCHES, MYF(0));
/*
Transform each subquery predicate according to its overloaded
transformer.
*/
if (subselect->select_transformer(join))
DBUG_RETURN(-1);

/*
If the subquery predicate is IN/=ANY, analyse and set all possible
@@ -754,12 +760,6 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
allany_subs->add_strategy(strategy);
}

/*
Transform each subquery predicate according to its overloaded
transformer.
*/
if (subselect->select_transformer(join))
DBUG_RETURN(-1);
}
}
DBUG_RETURN(0);

0 comments on commit 7ccde2c

Please sign in to comment.
You can’t perform that action at this time.