mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
715dc5f99d
of the 5.3 code line after a merge with 5.2 on 2010-10-28 in order not to allow the cost to access a joined table to be equal to 0 ever. Expanded data sets for many test cases to get the same execution plans as before.
51 lines
1.6 KiB
Text
51 lines
1.6 KiB
Text
#
|
|
# Run subselect_sj.test with BKA enabled
|
|
#
|
|
|
|
set @save_optimizer_switch_jcl6=@@optimizer_switch;
|
|
set @@optimizer_switch='optimize_join_buffer_size=on';
|
|
set @@optimizer_switch='semijoin=on,firstmatch=on,loosescan=on';
|
|
set @@optimizer_switch='semijoin_with_cache=on';
|
|
set @@optimizer_switch='outer_join_with_cache=on';
|
|
set @@optimizer_switch='join_cache_hashed=off';
|
|
set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on';
|
|
|
|
set join_cache_level=6;
|
|
show variables like 'join_cache_level';
|
|
|
|
--source t/subselect_sj.test
|
|
|
|
--echo #
|
|
--echo # BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off
|
|
--echo #
|
|
CREATE TABLE t0 (a INT);
|
|
INSERT INTO t0 VALUES (0),(1),(2),(3),(4);
|
|
CREATE TABLE t1 (a INT, b INT, KEY(a));
|
|
INSERT INTO t1 SELECT a, a from t0;
|
|
INSERT INTO t1 SELECT a+5, a from t0;
|
|
INSERT INTO t1 SELECT a+10, a from t0;
|
|
CREATE TABLE t2 (a INT, b INT, PRIMARY KEY(a));
|
|
INSERT INTO t2 SELECT * FROM t1;
|
|
UPDATE t1 SET a=3, b=11 WHERE a=4;
|
|
UPDATE t2 SET b=11 WHERE a=3;
|
|
|
|
set @save_optimizer_switch=@@optimizer_switch;
|
|
set optimizer_switch='firstmatch=off';
|
|
|
|
--echo The following should use a join order of t0,t1,t2, with DuplicateElimination:
|
|
explain
|
|
SELECT * FROM t0 WHERE t0.a IN
|
|
(SELECT t1.a FROM t1, t2 WHERE t2.a=t0.a AND t1.b=t2.b);
|
|
|
|
SELECT * FROM t0 WHERE t0.a IN
|
|
(SELECT t1.a FROM t1, t2 WHERE t2.a=t0.a AND t1.b=t2.b);
|
|
|
|
set optimizer_switch=@save_optimizer_switch;
|
|
drop table t0, t1, t2;
|
|
|
|
--echo # End
|
|
|
|
set join_cache_level=default;
|
|
show variables like 'join_cache_level';
|
|
|
|
set @@optimizer_switch=@save_optimizer_switch_jcl6;
|