diff options
author | Igor Babaev <igor@askmonty.org> | 2010-11-15 21:07:32 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2010-11-15 21:07:32 -0800 |
commit | e25ac681c935853b5b61dbac421d0b3b3c834475 (patch) | |
tree | f84693efd63b84bc0924eced120e304ff036ecb4 /mysql-test/r/join_cache.result | |
parent | 42cd36431b1f6f3e129a27630953f86c0567d5a8 (diff) | |
download | mariadb-git-e25ac681c935853b5b61dbac421d0b3b3c834475.tar.gz |
Fixed LP bug #675516.
When pushing the condition for a table in the function
JOIN_TAB::make_scan_filter the optimizer must not push
conditions from WHERE if the table is some inner table
of an outer join..
Diffstat (limited to 'mysql-test/r/join_cache.result')
-rw-r--r-- | mysql-test/r/join_cache.result | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/mysql-test/r/join_cache.result b/mysql-test/r/join_cache.result index ad4fd908ea5..d838b5bf7a4 100644 --- a/mysql-test/r/join_cache.result +++ b/mysql-test/r/join_cache.result @@ -5921,4 +5921,52 @@ pk a1 pk a2 c2 d2 pk a3 c3 d3 pk a4 pk a5 SET SESSION optimizer_switch = 'outer_join_with_cache=off'; SET SESSION join_cache_level = DEFAULT; DROP TABLE t1,t2,t3,t4,t5; +# +# Bug #675516: nested outer join with 3 tables in the nest +# using BNL + BNLH +# +CREATE TABLE t1 (a1 int, b1 int, c1 int) ; +INSERT INTO t1 VALUES (7,8,0), (6,4,0); +CREATE TABLE t2 (a2 int) ; +INSERT INTO t2 VALUES (5); +CREATE TABLE t3 (a3 int, b3 int, c3 int, PRIMARY KEY (b3)) ; +INSERT INTO t3 VALUES (2,5,0); +CREATE TABLE t4 (a4 int, b4 int, c4 int) ; +INSERT INTO t4 VALUES (7,8,0); +SET SESSION optimizer_switch = 'outer_join_with_cache=on'; +SET SESSION join_cache_level = 4; +EXPLAIN +SELECT * FROM +t1 LEFT JOIN +((t2 JOIN t3 ON t2.a2 = t3.b3) JOIN t4 ON t4.b4 <> 0) ON t1.c1 = t3.c3 +WHERE t3.a3 IS NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.a2 1 Using where; Using join buffer (incremental, BNLH join) +1 SIMPLE t4 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join) +SELECT * FROM +t1 LEFT JOIN +((t2 JOIN t3 ON t2.a2 = t3.b3) JOIN t4 ON t4.b4 <> 0) ON t1.c1 = t3.c3 +WHERE t3.a3 IS NULL; +a1 b1 c1 a2 a3 b3 c3 a4 b4 c4 +SET SESSION join_cache_level = 0; +EXPLAIN +SELECT * FROM +t1 LEFT JOIN +((t2 JOIN t3 ON t2.a2 = t3.b3) JOIN t4 ON t4.b4 <> 0) ON t1.c1 = t3.c3 +WHERE t3.a3 IS NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 +1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where +1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.a2 1 Using where +1 SIMPLE t4 ALL NULL NULL NULL NULL 1 Using where +SELECT * FROM +t1 LEFT JOIN +((t2 JOIN t3 ON t2.a2 = t3.b3) JOIN t4 ON t4.b4 <> 0) ON t1.c1 = t3.c3 +WHERE t3.a3 IS NULL; +a1 b1 c1 a2 a3 b3 c3 a4 b4 c4 +SET SESSION optimizer_switch = 'outer_join_with_cache=off'; +SET SESSION join_cache_level = DEFAULT; +DROP TABLE t1,t2,t3,t4; set @@optimizer_switch=@save_optimizer_switch; |