summaryrefslogtreecommitdiff
path: root/mysql-test/r/join_nested.result
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-07-29 17:09:16 -0700
committerIgor Babaev <igor@askmonty.org>2011-07-29 17:09:16 -0700
commit103c4461ca5dfa85516652afd195c75ab69b1db7 (patch)
tree75c138e6c2698c4dc8fc48809e812c7944f6e6b6 /mysql-test/r/join_nested.result
parentcfa08e8dadefc00e9542953a4a672b3a34f34303 (diff)
downloadmariadb-git-103c4461ca5dfa85516652afd195c75ab69b1db7.tar.gz
Fixed LP bug #817360.
This problem could be observed for queries with nested outer joins for which the not_exist optimization were applicable. The problem was caused by the code of the patch for bug #49322 that erroneously forced the return to the previous nested loop level when the join algorithm successfully builds a partial record for an embedded outer to which the not_exist optimization could be applied. Actually the immediate return to the previous nested loops level is correct only if this partial record is rejected by a predicate pushed down to one of the inner tables of this outer join. Otherwise attempts to find extensions of this record must be made.
Diffstat (limited to 'mysql-test/r/join_nested.result')
-rw-r--r--mysql-test/r/join_nested.result31
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/r/join_nested.result b/mysql-test/r/join_nested.result
index 0b1fdf8d0bb..bdf650b97bc 100644
--- a/mysql-test/r/join_nested.result
+++ b/mysql-test/r/join_nested.result
@@ -1801,4 +1801,35 @@ pk a pk a pk a
7 NULL NULL NULL NULL NULL
8 9 NULL NULL NULL NULL
DROP TABLE t1, t2, t3;
+CREATE TABLE t1 (a int NOT NULL );
+INSERT INTO t1 VALUES (9), (9);
+CREATE TABLE t2 (a int NOT NULL );
+INSERT INTO t2 VALUES (9);
+CREATE TABLE t3 (a int NOT NULL, b int);
+INSERT INTO t3 VALUES (19,9);
+CREATE TABLE t4 (b int) ;
+SELECT * FROM t1 LEFT JOIN
+((t2 LEFT JOIN t3 ON t2.a=t3.b) LEFT JOIN t4 ON t3.a=t4.b)
+ON t1.a=t2.a;
+a a a b b
+9 9 19 9 NULL
+9 9 19 9 NULL
+SELECT * FROM t1 LEFT JOIN
+((t2 LEFT JOIN t3 ON t2.a=t3.b) LEFT JOIN t4 ON t3.a=t4.b)
+ON t1.a=t2.a
+WHERE t3.a IS NULL;
+a a a b b
+EXPLAIN EXTENDED
+SELECT * FROM t1 LEFT JOIN
+((t2 LEFT JOIN t3 ON t2.a=t3.b) LEFT JOIN t4 ON t3.a=t4.b)
+ON t1.a=t2.a
+WHERE t3.a IS NULL;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00 Using where
+1 SIMPLE t3 ALL NULL NULL NULL NULL 1 100.00 Using where; Not exists
+1 SIMPLE t4 ALL NULL NULL NULL NULL 0 0.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`b` AS `b` from `test`.`t1` left join (`test`.`t2` left join `test`.`t3` on(((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t3`.`b` = `test`.`t1`.`a`))) left join `test`.`t4` on((`test`.`t4`.`b` = `test`.`t3`.`a`))) on((`test`.`t2`.`a` = `test`.`t1`.`a`)) where isnull(`test`.`t3`.`a`)
+DROP TABLE t1,t2,t3,t4;
End of 5.0 tests