Skip to content

Commit 339a290

Browse files
committed
Merge remote-tracking branch 'origin/5.5' into 10.0
2 parents b87873b + 934b831 commit 339a290

19 files changed

+452
-19
lines changed

mysql-test/r/derived_view.result

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2591,5 +2591,43 @@ Handler_read_rnd_deleted 0
25912591
Handler_read_rnd_next 27
25922592
deallocate prepare stmt1;
25932593
drop table t1,t2;
2594+
#
2595+
# Bug mdev-12670: mergeable derived / view with subqueries
2596+
# subject to semi-join optimizations
2597+
# (actually this is a 5.3 bug.)
2598+
#
2599+
create table t1 (a int) engine=myisam;
2600+
insert into t1 values (5),(3),(2),(7),(2),(5),(1);
2601+
create table t2 (b int, index idx(b)) engine=myisam;
2602+
insert into t2 values (2),(3),(2),(1),(3),(4);
2603+
insert into t2 select b+10 from t2;
2604+
insert into t2 select b+10 from t2;
2605+
insert into t2 select b+10 from t2;
2606+
insert into t2 select b+10 from t2;
2607+
insert into t2 select b+10 from t2;
2608+
insert into t2 select b+10 from t2;
2609+
insert into t2 select b+10 from t2;
2610+
insert into t2 select b+10 from t2;
2611+
insert into t2 select b+10 from t2;
2612+
insert into t2 select b+10 from t2;
2613+
analyze table t1,t2;
2614+
Table Op Msg_type Msg_text
2615+
test.t1 analyze status OK
2616+
test.t2 analyze status OK
2617+
explain select a from t1 where a in (select b from t2);
2618+
id select_type table type possible_keys key key_len ref rows Extra
2619+
1 PRIMARY t1 ALL NULL NULL NULL NULL 7 Using where
2620+
1 PRIMARY t2 ref idx idx 5 test.t1.a 140 Using index; FirstMatch(t1)
2621+
explain select * from (select a from t1 where a in (select b from t2)) t;
2622+
id select_type table type possible_keys key key_len ref rows Extra
2623+
1 PRIMARY t1 ALL NULL NULL NULL NULL 7 Using where
2624+
1 PRIMARY t2 ref idx idx 5 test.t1.a 140 Using index; FirstMatch(t1)
2625+
create view v1 as select a from t1 where a in (select b from t2);
2626+
explain select * from v1;
2627+
id select_type table type possible_keys key key_len ref rows Extra
2628+
1 PRIMARY t1 ALL NULL NULL NULL NULL 7 Using where
2629+
1 PRIMARY t2 ref idx idx 5 test.t1.a 140 Using index; FirstMatch(t1)
2630+
drop view v1;
2631+
drop table t1,t2;
25942632
set optimizer_switch=@exit_optimizer_switch;
25952633
set join_cache_level=@exit_join_cache_level;

mysql-test/r/limit_rows_examined.result

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ c1
426426
bb
427427
cc
428428
Warnings:
429-
Warning 1931 Query execution was interrupted. The query examined at least 18 rows, which exceeds LIMIT ROWS EXAMINED (16). The query result may be incomplete.
429+
Warning 1931 Query execution was interrupted. The query examined at least 17 rows, which exceeds LIMIT ROWS EXAMINED (16). The query result may be incomplete.
430430
select * from v1 LIMIT ROWS EXAMINED 11;
431431
c1
432432
bb
@@ -439,7 +439,8 @@ from (select * from t1
439439
where c1 IN (select * from t2 where c2 > ' ' LIMIT ROWS EXAMINED 0)) as tmp
440440
LIMIT ROWS EXAMINED 11;
441441
id select_type table type possible_keys key key_len ref rows Extra
442-
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
442+
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
443+
1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 2 func 1
443444
3 MATERIALIZED t2 ALL NULL NULL NULL NULL 4 Using where
444445
select *
445446
from (select * from t1

mysql-test/r/subselect_mat_cost_bugs.result

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ drop table t3, t4, t5;
379379
#
380380
# LP BUG#858038 The result of a query with NOT IN subquery depends on the state of the optimizer switch
381381
#
382+
set @optimizer_switch_save= @@optimizer_switch;
382383
create table t1 (c1 char(2) not null, c2 char(2));
383384
create table t2 (c3 char(2), c4 char(2));
384385
insert into t1 values ('a1', 'b1');
@@ -400,6 +401,7 @@ id select_type table type possible_keys key key_len ref rows Extra
400401
select * from t1 where c1 = 'a2' and (c1, c2) not in (select * from t2);
401402
c1 c2
402403
drop table t1, t2;
404+
set optimizer_switch= @optimizer_switch_save;
403405
#
404406
# MDEV-12673: cost-based choice between materialization and in-to-exists
405407
#
@@ -442,3 +444,44 @@ id select_type table type possible_keys key key_len ref rows Extra
442444
2 DEPENDENT SUBQUERY t3 const PRIMARY PRIMARY 4 const 1
443445
2 DEPENDENT SUBQUERY t2 index NULL i2 11 NULL 2 Using where; Using index
444446
DROP TABLE t1,t2,t3;
447+
#
448+
# MDEV-7599: in-to-exists chosen after min/max optimization
449+
#
450+
set @optimizer_switch_save= @@optimizer_switch;
451+
CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
452+
INSERT INTO t1 VALUES (1),(2);
453+
CREATE TABLE t2 (b INT, c INT) ENGINE=MyISAM;
454+
INSERT INTO t2 VALUES (1,6),(2,4), (8,9);
455+
SELECT * FROM t2 WHERE b != ALL (SELECT MIN(a) FROM t1, t2 WHERE t2.c = t2.b);
456+
b c
457+
EXPLAIN EXTENDED SELECT * FROM t2 WHERE b != ALL (SELECT MIN(a) FROM t1, t2 WHERE t2.c = t2.b);
458+
id select_type table type possible_keys key key_len ref rows filtered Extra
459+
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where
460+
2 MATERIALIZED t1 index NULL a 5 NULL 2 100.00 Using index
461+
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
462+
Warnings:
463+
Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (not(<expr_cache><`test`.`t2`.`b`>(<in_optimizer>(`test`.`t2`.`b`,`test`.`t2`.`b` in ( <materialize> (select min(`test`.`t1`.`a`) from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`c` = `test`.`t2`.`b`) ), <primary_index_lookup>(`test`.`t2`.`b` in <temporary table> on distinct_key where ((`test`.`t2`.`b` = `<subquery2>`.`MIN(a)`))))))))
464+
set optimizer_switch= 'materialization=off';
465+
SELECT * FROM t2 WHERE b != ALL (SELECT MIN(a) FROM t1, t2 WHERE t2.c = t2.b);
466+
b c
467+
EXPLAIN EXTENDED SELECT * FROM t2 WHERE b != ALL (SELECT MIN(a) FROM t1, t2 WHERE t2.c = t2.b);
468+
id select_type table type possible_keys key key_len ref rows filtered Extra
469+
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where
470+
2 DEPENDENT SUBQUERY t1 index NULL a 5 NULL 2 100.00 Using index
471+
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
472+
Warnings:
473+
Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (not(<expr_cache><`test`.`t2`.`b`>(<in_optimizer>(`test`.`t2`.`b`,<exists>(select min(`test`.`t1`.`a`) from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`c` = `test`.`t2`.`b`) having trigcond((<cache>(`test`.`t2`.`b`) = <ref_null_helper>(min(`test`.`t1`.`a`)))))))))
474+
set optimizer_switch= @optimizer_switch_save;
475+
DROP TABLE t1,t2;
476+
CREATE TABLE t1 (f1 varchar(10)) ENGINE=MyISAM;
477+
INSERT INTO t1 VALUES ('foo'),('bar');
478+
CREATE TABLE t2 (f2 varchar(10), key(f2)) ENGINE=MyISAM;
479+
INSERT INTO t2 VALUES ('baz'),('qux');
480+
CREATE TABLE t3 (f3 varchar(10)) ENGINE=MyISAM;
481+
INSERT INTO t3 VALUES ('abc'),('def');
482+
SELECT * FROM t1
483+
WHERE f1 = ALL( SELECT MAX(t2a.f2)
484+
FROM t2 AS t2a INNER JOIN t2 t2b INNER JOIN t3
485+
ON (f3 = t2b.f2) );
486+
f1
487+
DROP TABLE t1,t2,t3;

mysql-test/r/subselect_sj.result

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1652,9 +1652,9 @@ CREATE VIEW v1 AS SELECT 1;
16521652
EXPLAIN
16531653
SELECT * FROM t1 INNER JOIN t2 ON t2.a != 0 AND t2.a IN (SELECT * FROM v1);
16541654
id select_type table type possible_keys key key_len ref rows Extra
1655+
1 PRIMARY <derived3> system NULL NULL NULL NULL 1
16551656
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
16561657
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
1657-
2 MATERIALIZED <derived3> system NULL NULL NULL NULL 1
16581658
3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
16591659
SELECT * FROM t1 INNER JOIN t2 ON t2.a != 0 AND t2.a IN (SELECT * FROM v1);
16601660
a a
@@ -3062,4 +3062,43 @@ project_number
30623062
aaa
30633063
drop table t1, t2, t3;
30643064
set optimizer_switch= @tmp_mdev6859;
3065+
#
3066+
# MDEV-12675: subquery subject to semi-join optimizations
3067+
# in ON expression of INNER JOIN
3068+
#
3069+
set @tmp_mdev12675=@@optimizer_switch;
3070+
set optimizer_switch=default;
3071+
create table t1 (a int) engine=myisam;
3072+
insert into t1 values (5),(3),(2),(7),(2),(5),(1);
3073+
create table t2 (b int, index idx(b)) engine=myisam;
3074+
insert into t2 values (2),(3),(2),(1),(3),(4);
3075+
insert into t2 select b+10 from t2;
3076+
insert into t2 select b+10 from t2;
3077+
insert into t2 select b+10 from t2;
3078+
insert into t2 select b+10 from t2;
3079+
insert into t2 select b+10 from t2;
3080+
insert into t2 select b+10 from t2;
3081+
insert into t2 select b+10 from t2;
3082+
insert into t2 select b+10 from t2;
3083+
insert into t2 select b+10 from t2;
3084+
insert into t2 select b+10 from t2;
3085+
insert into t2 select b+10 from t2;
3086+
analyze table t1,t2;
3087+
Table Op Msg_type Msg_text
3088+
test.t1 analyze status OK
3089+
test.t2 analyze status OK
3090+
explain
3091+
select a from t1, t2 where b between 1 and 2 and a in (select b from t2);
3092+
id select_type table type possible_keys key key_len ref rows Extra
3093+
1 PRIMARY t1 ALL NULL NULL NULL NULL 7 Using where
3094+
1 PRIMARY t2 ref idx idx 5 test.t1.a 256 Using index; FirstMatch(t1)
3095+
1 PRIMARY t2 range idx idx 5 NULL 2 Using where; Using index; Using join buffer (flat, BNL join)
3096+
explain
3097+
select a from t1 join t2 on b between 1 and 2 and a in (select b from t2);
3098+
id select_type table type possible_keys key key_len ref rows Extra
3099+
1 PRIMARY t1 ALL NULL NULL NULL NULL 7 Using where
3100+
1 PRIMARY t2 ref idx idx 5 test.t1.a 256 Using index; FirstMatch(t1)
3101+
1 PRIMARY t2 range idx idx 5 NULL 2 Using where; Using index; Using join buffer (flat, BNL join)
3102+
drop table t1,t2;
3103+
set optimizer_switch= @tmp_mdev12675;
30653104
set optimizer_switch=@subselect_sj_tmp;

mysql-test/r/subselect_sj2_mat.result

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,3 +1589,26 @@ i1
15891589
DROP TABLE t1,t2,t3;
15901590
set join_cache_level= @save_join_cache_level;
15911591
set optimizer_switch=@save_optimizer_switch;
1592+
#
1593+
# mdev-7791: materialization of a semi-join subquery +
1594+
# RAND() in WHERE
1595+
# (materialized table is accessed last)
1596+
#
1597+
set @save_optimizer_switch=@@optimizer_switch;
1598+
set optimizer_switch='materialization=on';
1599+
create table t1(i int);
1600+
insert into t1 values (1), (2), (3), (7), (9), (10);
1601+
create table t2(i int);
1602+
insert into t2 values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
1603+
select * from t1 where (rand() < 0) and i in (select i from t2);
1604+
i
1605+
explain extended
1606+
select * from t1 where (rand() < 0) and i in (select i from t2);
1607+
id select_type table type possible_keys key key_len ref rows filtered Extra
1608+
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
1609+
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
1610+
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 10 100.00
1611+
Warnings:
1612+
Note 1003 select `test`.`t1`.`i` AS `i` from `test`.`t1` semi join (`test`.`t2`) where ((rand() < 0))
1613+
drop table t1,t2;
1614+
set optimizer_switch=@save_optimizer_switch;

mysql-test/r/subselect_sj_jcl6.result

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1665,9 +1665,9 @@ CREATE VIEW v1 AS SELECT 1;
16651665
EXPLAIN
16661666
SELECT * FROM t1 INNER JOIN t2 ON t2.a != 0 AND t2.a IN (SELECT * FROM v1);
16671667
id select_type table type possible_keys key key_len ref rows Extra
1668+
1 PRIMARY <derived3> system NULL NULL NULL NULL 1
16681669
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
16691670
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
1670-
2 MATERIALIZED <derived3> system NULL NULL NULL NULL 1
16711671
3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
16721672
SELECT * FROM t1 INNER JOIN t2 ON t2.a != 0 AND t2.a IN (SELECT * FROM v1);
16731673
a a
@@ -3076,6 +3076,45 @@ project_number
30763076
aaa
30773077
drop table t1, t2, t3;
30783078
set optimizer_switch= @tmp_mdev6859;
3079+
#
3080+
# MDEV-12675: subquery subject to semi-join optimizations
3081+
# in ON expression of INNER JOIN
3082+
#
3083+
set @tmp_mdev12675=@@optimizer_switch;
3084+
set optimizer_switch=default;
3085+
create table t1 (a int) engine=myisam;
3086+
insert into t1 values (5),(3),(2),(7),(2),(5),(1);
3087+
create table t2 (b int, index idx(b)) engine=myisam;
3088+
insert into t2 values (2),(3),(2),(1),(3),(4);
3089+
insert into t2 select b+10 from t2;
3090+
insert into t2 select b+10 from t2;
3091+
insert into t2 select b+10 from t2;
3092+
insert into t2 select b+10 from t2;
3093+
insert into t2 select b+10 from t2;
3094+
insert into t2 select b+10 from t2;
3095+
insert into t2 select b+10 from t2;
3096+
insert into t2 select b+10 from t2;
3097+
insert into t2 select b+10 from t2;
3098+
insert into t2 select b+10 from t2;
3099+
insert into t2 select b+10 from t2;
3100+
analyze table t1,t2;
3101+
Table Op Msg_type Msg_text
3102+
test.t1 analyze status OK
3103+
test.t2 analyze status OK
3104+
explain
3105+
select a from t1, t2 where b between 1 and 2 and a in (select b from t2);
3106+
id select_type table type possible_keys key key_len ref rows Extra
3107+
1 PRIMARY t1 ALL NULL NULL NULL NULL 7 Using where
3108+
1 PRIMARY t2 ref idx idx 5 test.t1.a 256 Using index; FirstMatch(t1)
3109+
1 PRIMARY t2 range idx idx 5 NULL 2 Using where; Using index; Using join buffer (flat, BNL join)
3110+
explain
3111+
select a from t1 join t2 on b between 1 and 2 and a in (select b from t2);
3112+
id select_type table type possible_keys key key_len ref rows Extra
3113+
1 PRIMARY t1 ALL NULL NULL NULL NULL 7 Using where
3114+
1 PRIMARY t2 ref idx idx 5 test.t1.a 256 Using index; FirstMatch(t1)
3115+
1 PRIMARY t2 range idx idx 5 NULL 2 Using where; Using index; Using join buffer (flat, BNL join)
3116+
drop table t1,t2;
3117+
set optimizer_switch= @tmp_mdev12675;
30793118
set optimizer_switch=@subselect_sj_tmp;
30803119
#
30813120
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off

mysql-test/t/derived_view.test

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,6 +1881,36 @@ deallocate prepare stmt1;
18811881

18821882
drop table t1,t2;
18831883

1884+
--echo #
1885+
--echo # Bug mdev-12670: mergeable derived / view with subqueries
1886+
--echo # subject to semi-join optimizations
1887+
--echo # (actually this is a 5.3 bug.)
1888+
--echo #
1889+
1890+
create table t1 (a int) engine=myisam;
1891+
insert into t1 values (5),(3),(2),(7),(2),(5),(1);
1892+
create table t2 (b int, index idx(b)) engine=myisam;
1893+
insert into t2 values (2),(3),(2),(1),(3),(4);
1894+
insert into t2 select b+10 from t2;
1895+
insert into t2 select b+10 from t2;
1896+
insert into t2 select b+10 from t2;
1897+
insert into t2 select b+10 from t2;
1898+
insert into t2 select b+10 from t2;
1899+
insert into t2 select b+10 from t2;
1900+
insert into t2 select b+10 from t2;
1901+
insert into t2 select b+10 from t2;
1902+
insert into t2 select b+10 from t2;
1903+
insert into t2 select b+10 from t2;
1904+
analyze table t1,t2;
1905+
1906+
explain select a from t1 where a in (select b from t2);
1907+
explain select * from (select a from t1 where a in (select b from t2)) t;
1908+
create view v1 as select a from t1 where a in (select b from t2);
1909+
explain select * from v1;
1910+
1911+
drop view v1;
1912+
drop table t1,t2;
1913+
18841914
# The following command must be the last one the file
18851915
set optimizer_switch=@exit_optimizer_switch;
18861916
set join_cache_level=@exit_join_cache_level;

mysql-test/t/subselect_mat_cost_bugs.test

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,8 @@ drop table t3, t4, t5;
406406
--echo # LP BUG#858038 The result of a query with NOT IN subquery depends on the state of the optimizer switch
407407
--echo #
408408

409+
set @optimizer_switch_save= @@optimizer_switch;
410+
409411
create table t1 (c1 char(2) not null, c2 char(2));
410412
create table t2 (c3 char(2), c4 char(2));
411413

@@ -425,6 +427,8 @@ select * from t1 where c1 = 'a2' and (c1, c2) not in (select * from t2);
425427

426428
drop table t1, t2;
427429

430+
set optimizer_switch= @optimizer_switch_save;
431+
428432
--echo #
429433
--echo # MDEV-12673: cost-based choice between materialization and in-to-exists
430434
--echo #
@@ -463,3 +467,43 @@ SELECT * FROM t1 WHERE i1 NOT IN (
463467
);
464468

465469
DROP TABLE t1,t2,t3;
470+
471+
--echo #
472+
--echo # MDEV-7599: in-to-exists chosen after min/max optimization
473+
--echo #
474+
475+
set @optimizer_switch_save= @@optimizer_switch;
476+
477+
CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
478+
INSERT INTO t1 VALUES (1),(2);
479+
480+
CREATE TABLE t2 (b INT, c INT) ENGINE=MyISAM;
481+
INSERT INTO t2 VALUES (1,6),(2,4), (8,9);
482+
483+
let $q=
484+
SELECT * FROM t2 WHERE b != ALL (SELECT MIN(a) FROM t1, t2 WHERE t2.c = t2.b);
485+
486+
eval $q;
487+
eval EXPLAIN EXTENDED $q;
488+
set optimizer_switch= 'materialization=off';
489+
eval $q;
490+
eval EXPLAIN EXTENDED $q;
491+
set optimizer_switch= @optimizer_switch_save;
492+
493+
DROP TABLE t1,t2;
494+
495+
CREATE TABLE t1 (f1 varchar(10)) ENGINE=MyISAM;
496+
INSERT INTO t1 VALUES ('foo'),('bar');
497+
498+
CREATE TABLE t2 (f2 varchar(10), key(f2)) ENGINE=MyISAM;
499+
INSERT INTO t2 VALUES ('baz'),('qux');
500+
501+
CREATE TABLE t3 (f3 varchar(10)) ENGINE=MyISAM;
502+
INSERT INTO t3 VALUES ('abc'),('def');
503+
504+
SELECT * FROM t1
505+
WHERE f1 = ALL( SELECT MAX(t2a.f2)
506+
FROM t2 AS t2a INNER JOIN t2 t2b INNER JOIN t3
507+
ON (f3 = t2b.f2) );
508+
509+
DROP TABLE t1,t2,t3;

mysql-test/t/subselect_sj.test

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2773,5 +2773,37 @@ WHERE ( SELECT z.country
27732773
drop table t1, t2, t3;
27742774
set optimizer_switch= @tmp_mdev6859;
27752775

2776+
--echo #
2777+
--echo # MDEV-12675: subquery subject to semi-join optimizations
2778+
--echo # in ON expression of INNER JOIN
2779+
--echo #
2780+
2781+
set @tmp_mdev12675=@@optimizer_switch;
2782+
set optimizer_switch=default;
2783+
create table t1 (a int) engine=myisam;
2784+
insert into t1 values (5),(3),(2),(7),(2),(5),(1);
2785+
create table t2 (b int, index idx(b)) engine=myisam;
2786+
insert into t2 values (2),(3),(2),(1),(3),(4);
2787+
insert into t2 select b+10 from t2;
2788+
insert into t2 select b+10 from t2;
2789+
insert into t2 select b+10 from t2;
2790+
insert into t2 select b+10 from t2;
2791+
insert into t2 select b+10 from t2;
2792+
insert into t2 select b+10 from t2;
2793+
insert into t2 select b+10 from t2;
2794+
insert into t2 select b+10 from t2;
2795+
insert into t2 select b+10 from t2;
2796+
insert into t2 select b+10 from t2;
2797+
insert into t2 select b+10 from t2;
2798+
analyze table t1,t2;
2799+
2800+
explain
2801+
select a from t1, t2 where b between 1 and 2 and a in (select b from t2);
2802+
explain
2803+
select a from t1 join t2 on b between 1 and 2 and a in (select b from t2);
2804+
2805+
drop table t1,t2;
2806+
set optimizer_switch= @tmp_mdev12675;
2807+
27762808
# The following command must be the last one the file
27772809
set optimizer_switch=@subselect_sj_tmp;

0 commit comments

Comments
 (0)