summaryrefslogtreecommitdiff
path: root/mysql-test/t/join_nested.test
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-06-15 05:56:19 -0700
committerunknown <igor@rurik.mysql.com>2005-06-15 05:56:19 -0700
commitad57284c6925fe19c182e5b43562e131e1297d7b (patch)
tree620c44e385924a55af053c4edb01c7f0ba74eb36 /mysql-test/t/join_nested.test
parent67c204c46b637a9c7b1323a2fcd443d6476ec5de (diff)
downloadmariadb-git-ad57284c6925fe19c182e5b43562e131e1297d7b.tar.gz
join_nested.result, join_nested.test:
Added a teast case for bug #11284. sql_select.cc: Fixed bug #11284. Optimization with empty inner table currently cannot be used in the case of nested outer join. sql/sql_select.cc: Fixed bug #11284. Optimization with empty inner table currently cannot be used in the case of nested outer join. mysql-test/t/join_nested.test: Added a teast case for bug #11284.
Diffstat (limited to 'mysql-test/t/join_nested.test')
-rw-r--r--mysql-test/t/join_nested.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/t/join_nested.test b/mysql-test/t/join_nested.test
index 9591f1fa7ed..992217d0391 100644
--- a/mysql-test/t/join_nested.test
+++ b/mysql-test/t/join_nested.test
@@ -752,3 +752,21 @@ EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
DROP TABLE t1,t2,t3;
+
+#
+# Test for bug #11284: empty table in a nested left join
+#
+
+CREATE TABLE t1 (c11 int);
+CREATE TABLE t2 (c21 int);
+CREATE TABLE t3 (c31 int);
+
+INSERT INTO t1 VALUES (4), (5);
+
+SELECT * FROM t1 LEFT JOIN t2 ON c11=c21;
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON c11=c21;
+
+SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON c21=c31) ON c11=c21;
+EXPLAIN SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON c21=c31) ON c11=c21;
+
+DROP TABLE t1,t2,t3;