Commit c0ca15ab authored by Sergey Petrunya's avatar Sergey Petrunya

MDEV-4270: crash in fix_semijoin_strategies_for_picked_join_order

- Added testcase
parent b3720ff7
...@@ -476,3 +476,25 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -476,3 +476,25 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t10 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t10 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
drop view v1; drop view v1;
drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16; drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16;
#
# MDEV-4270: crash in fix_semijoin_strategies_for_picked_join_order
#
drop table if exists t1,t2,t3;
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 't2'
Note 1051 Unknown table 't3'
create table t2(a int,unique key (a)) engine=innodb;
create table t3(b int) engine=innodb;
create table t1(a int,b int)engine=innodb;
set @mdev4270_opl= @@optimizer_prune_level;
set @mdev4270_osd= @@optimizer_search_depth;
set optimizer_prune_level=0;
set optimizer_search_depth=2;
select 1 from t1 join t2 a
natural left join t2 b
natural right outer join t3;
1
drop table t1,t2,t3;
set optimizer_prune_level=@mdev4270_opl;
set optimizer_search_depth=@mdev4270_osd;
...@@ -350,3 +350,26 @@ explain select * from v1; ...@@ -350,3 +350,26 @@ explain select * from v1;
drop view v1; drop view v1;
drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16; drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16;
--echo #
--echo # MDEV-4270: crash in fix_semijoin_strategies_for_picked_join_order
--echo #
drop table if exists t1,t2,t3;
create table t2(a int,unique key (a)) engine=innodb;
create table t3(b int) engine=innodb;
create table t1(a int,b int)engine=innodb;
set @mdev4270_opl= @@optimizer_prune_level;
set @mdev4270_osd= @@optimizer_search_depth;
set optimizer_prune_level=0;
set optimizer_search_depth=2;
select 1 from t1 join t2 a
natural left join t2 b
natural right outer join t3;
drop table t1,t2,t3;
set optimizer_prune_level=@mdev4270_opl;
set optimizer_search_depth=@mdev4270_osd;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment