Merge 10.3 into 10.4

This commit is contained in:
Marko Mäkelä 2021-03-27 17:12:28 +02:00
commit 7ae37ff74f
54 changed files with 701 additions and 624 deletions

View file

@ -3479,6 +3479,43 @@ SELECT * from v1 WHERE a=3;
DROP VIEW v1;
DROP TABLE t1;
--echo #
--echo # MDEV-25128: Split optimization for join with materialized semi-join
--echo #
create table t1 (id int, a int, index (a), index (id, a)) engine=myisam;
insert into t1 values
(17,1),(17,3010),(17,3013),(17,3053),(21,2446),(21,2467),(21,2);
create table t2 (a int) engine=myisam;
insert into t2 values (1),(2),(3);
create table t3 (id int) engine=myisam;
insert into t3 values (1),(2);
analyze table t1,t2,t3;
let $q=
select * from t1, (select a from t1 cp2 group by a) dt, t3
where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2);
set optimizer_switch="split_materialized=off";
eval $q;
eval explain $q;
eval explain format=json $q;
set optimizer_switch="split_materialized=default";
eval $q;
eval explain $q;
eval explain format=json $q;
eval prepare stmt from "$q";
execute stmt;
execute stmt;
deallocate prepare stmt;
drop table t1,t2,t3;
--echo # End of 10.3 tests
--echo #