summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2004-08-06 10:22:20 -0700
committerunknown <igor@rurik.mysql.com>2004-08-06 10:22:20 -0700
commit3478d656d0b0894d9de16c03096746185be4489e (patch)
tree2ebf29b003c8dccb44d4fc2876cb34702cc0d6c1 /mysql-test/t
parent8a33c2bc8fb816c93baddaa04835d8dc5d7fde35 (diff)
downloadmariadb-git-3478d656d0b0894d9de16c03096746185be4489e.tar.gz
join_nested.result, join_nested.test:
Added a test case for bug #4922. sql_select.cc: Blocked an optimization performed by join_read_const_table when applied to an inner table of a nested outer join. It was done to fix bug #4922. sql_yacc.yy: Fixed a typo bug in the rule for join_table. sql/sql_yacc.yy: Fixed a typo bug in the rule for join_table. sql/sql_select.cc: Blocked an optimization performed by join_read_const_table when applied to an inner table of a nested outer join. It was done to fix bug #4922. mysql-test/t/join_nested.test: Added a test case for bug #4922. mysql-test/r/join_nested.result: Added a test case for bug #4922.
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/join_nested.test27
1 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/t/join_nested.test b/mysql-test/t/join_nested.test
index 8247a12fc56..8fd3958b509 100644
--- a/mysql-test/t/join_nested.test
+++ b/mysql-test/t/join_nested.test
@@ -700,3 +700,30 @@ SELECT t2.a,t2.b,t3.a1,t3.b
WHERE t2.a = 4 OR (t2.a > 4 AND t3.a1 IS NULL);
DROP TABLE t0,t1,t2,t3,t4,t5,t6,t7,t8,t9;
+
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int);
+CREATE TABLE t3 (a int);
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2);
+INSERT INTO t3 VALUES (2);
+INSERT INTO t1 VALUES (2);
+
+#check proper syntax for nested outer joins
+
+SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON t2.a=t3.a) ON t1.a=t3.a;
+
+#must be equivalent to:
+
+SELECT * FROM t1 LEFT JOIN t2 LEFT JOIN t3 ON t2.a=t3.a ON t1.a=t3.a;
+
+#check that everything is al right when all tables contain not more than 1 row
+#(bug #4922)
+
+DELETE FROM t1 WHERE a=2;
+SELECT * FROM t1 LEFT JOIN t2 LEFT JOIN t3 ON t2.a=t3.a ON t1.a=t3.a;
+DELETE FROM t2;
+SELECT * FROM t1 LEFT JOIN t2 LEFT JOIN t3 ON t2.a=t3.a ON t1.a=t3.a;
+
+DROP TABLE t1,t2,t3;