summaryrefslogtreecommitdiff
path: root/mysql-test/t/join_nested.test
diff options
context:
space:
mode:
authorunknown <ramil@mysql.com>2005-09-29 19:34:21 +0500
committerunknown <ramil@mysql.com>2005-09-29 19:34:21 +0500
commit7acbea3f3ff5c9f8db8ea8bb7c805b83ca1e7ada (patch)
treeb92888cf8a6e56a3a35f5b0f954106c5152500a8 /mysql-test/t/join_nested.test
parent35598ff536006eeedcc2263926d0ccee328d4b21 (diff)
downloadmariadb-git-7acbea3f3ff5c9f8db8ea8bb7c805b83ca1e7ada.tar.gz
fix for bug #13545: Server crash caused by select query.
sql/sql_base.cc: fix for bug #13545: Server crash caused by select query. - compare table qualifier only with tables which are not nested joins. - perform recursion accordingly. - DBUG_ASSERT(table_list->table); added before the find_field_in_table() call.
Diffstat (limited to 'mysql-test/t/join_nested.test')
-rw-r--r--mysql-test/t/join_nested.test31
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/t/join_nested.test b/mysql-test/t/join_nested.test
index 482c7f9f8b9..0592ec3152f 100644
--- a/mysql-test/t/join_nested.test
+++ b/mysql-test/t/join_nested.test
@@ -801,3 +801,34 @@ SELECT * FROM
DROP VIEW v1,v2;
DROP TABLE t1,t2,t3,t4;
+
+#
+# Bug #13545: problem with NATURAL/USING joins.
+#
+
+CREATE TABLE t1(a int);
+CREATE TABLE t2(b int);
+CREATE TABLE t3(c int, d int);
+CREATE TABLE t4(d int);
+CREATE TABLE t5(e int, f int);
+CREATE TABLE t6(f int);
+CREATE VIEW v1 AS
+ SELECT e FROM t5 JOIN t6 ON t5.e=t6.f;
+CREATE VIEW v2 AS
+ SELECT e FROM t5 NATURAL JOIN t6;
+
+SELECT t1.a FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c JOIN t4 USING(d);
+--error 1054
+SELECT t1.x FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c JOIN t4 USING(d);
+SELECT t1.a FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c NATURAL JOIN t4;
+--error 1054
+SELECT t1.x FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c NATURAL JOIN t4;
+SELECT v1.e FROM v1 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
+--error 1054
+SELECT v1.x FROM v1 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
+SELECT v2.e FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
+--error 1054
+SELECT v2.x FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
+
+DROP VIEW v1, v2;
+DROP TABLE t1, t2, t3, t4, t5, t6;