diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2012-04-19 04:50:32 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2012-04-19 04:50:32 +0400 |
commit | 994c6db2d17eb035625387f4f5d4bdd8552fb767 (patch) | |
tree | 33da3b89e83a968c02d214f467b30e97f4c1f6af /mysql-test/r/subselect_sj_jcl6.result | |
parent | 2004bd1736d0a984c12b1d56156f5552816c80f4 (diff) | |
download | mariadb-git-994c6db2d17eb035625387f4f5d4bdd8552fb767.tar.gz |
BUG#978479: Wrong result (extra rows) with derived_with_keys+loosescan+semijoin=ON, materialization=OFF
Part#1: make EXPLAIN's plan match the one by actual execution:
Item_subselect::used_tables() should return the same value irrespectively
of whether we're running an EXPLAIN or a SELECT.
Diffstat (limited to 'mysql-test/r/subselect_sj_jcl6.result')
-rw-r--r-- | mysql-test/r/subselect_sj_jcl6.result | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result index 704cde2afd2..454e0e36ed7 100644 --- a/mysql-test/r/subselect_sj_jcl6.result +++ b/mysql-test/r/subselect_sj_jcl6.result @@ -2675,6 +2675,33 @@ a DEALLOCATE PREPARE pstmt; DROP VIEW v1; DROP TABLE t1, t2; +# +# BUG#978479: Wrong result (extra rows) with derived_with_keys+loosescan+semijoin=ON, materialization=OFF +# +set @tmp_jcl_978479= @@join_cache_level; +set join_cache_level=0; +set @tmp_os_978479= @@optimizer_switch; +set optimizer_switch = 'derived_with_keys=on,loosescan=on,semijoin=on,materialization=off'; +# Part#1: make sure EXPLAIN is using LooseScan: +CREATE TABLE t1 ( a INT, b INT ); +INSERT INTO t1 VALUES +(4,0),(6,8),(3,1),(5,8),(3,9),(2,4), +(2,6),(9,1),(5,4),(7,7),(5,4); +CREATE ALGORITHM=TEMPTABLE +VIEW v1 AS SELECT * FROM t1; +# This will use LooseScan: +EXPLAIN +SELECT * FROM t1 AS t1_1, t1 AS t1_2 +WHERE (t1_1.a, t1_2.a) IN ( SELECT a, b FROM v1 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1_1 ALL NULL NULL NULL NULL 11 +1 PRIMARY <derived3> ALL NULL NULL NULL NULL 11 Using where; LooseScan +1 PRIMARY t1_2 ALL NULL NULL NULL NULL 11 Using where +3 DERIVED t1 ALL NULL NULL NULL NULL 11 +DROP VIEW v1; +DROP TABLE t1; +set @@join_cache_level= @tmp_jcl_978479; +set @@optimizer_switch= @tmp_os_978479; set optimizer_switch=@subselect_sj_tmp; # # BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off |