summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <gkodinov@mysql.com>2006-06-08 14:26:02 +0300
committerunknown <gkodinov@mysql.com>2006-06-08 14:26:02 +0300
commit6474219467e8c72d8818efa27e20be1fc1047694 (patch)
tree000bfb1394140151dde065dccba66acaec373cac /mysql-test
parentcbbd0fdb2c14984e8abf5f9dc8ee8280eda367a9 (diff)
parenta7566db788a2ce71751bce8fecf98507b8e37b8b (diff)
downloadmariadb-git-6474219467e8c72d8818efa27e20be1fc1047694.tar.gz
Merge mysql.com:/home/kgeorge/mysql/5.0/teamclean
into mysql.com:/home/kgeorge/mysql/5.0/B15355
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/join.result20
-rw-r--r--mysql-test/t/join.test25
2 files changed, 45 insertions, 0 deletions
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index 86288caf398..48b7730481f 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -744,3 +744,23 @@ select a2 from ((t1 natural join t2) join t3 on b=c1) natural join t4;
a2
1
drop table t1,t2,t3,t4;
+create table t1 (c int, b int);
+create table t2 (a int, b int);
+create table t3 (b int, c int);
+create table t4 (y int, c int);
+create table t5 (y int, z int);
+insert into t1 values (3,2);
+insert into t2 values (1,2);
+insert into t3 values (2,3);
+insert into t4 values (1,3);
+insert into t5 values (1,4);
+prepare stmt1 from "select * from ((t3 natural join (t1 natural join t2))
+natural join t4) natural join t5";
+execute stmt1;
+y c b a z
+1 3 2 1 4
+select * from ((t3 natural join (t1 natural join t2)) natural join t4)
+natural join t5;
+y c b a z
+1 3 2 1 4
+drop table t1, t2, t3, t4, t5;
diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test
index f6a57d5e230..27558a31d68 100644
--- a/mysql-test/t/join.test
+++ b/mysql-test/t/join.test
@@ -563,4 +563,29 @@ select a2 from ((t1 natural join t2) join t3 on b=c1) natural join t4;
drop table t1,t2,t3,t4;
+#
+# BUG#15355: Common natural join column not resolved in prepared statement nested query
+#
+create table t1 (c int, b int);
+create table t2 (a int, b int);
+create table t3 (b int, c int);
+create table t4 (y int, c int);
+create table t5 (y int, z int);
+
+insert into t1 values (3,2);
+insert into t2 values (1,2);
+insert into t3 values (2,3);
+insert into t4 values (1,3);
+insert into t5 values (1,4);
+
+-- this fails
+prepare stmt1 from "select * from ((t3 natural join (t1 natural join t2))
+natural join t4) natural join t5";
+execute stmt1;
+
+-- this works
+select * from ((t3 natural join (t1 natural join t2)) natural join t4)
+ natural join t5;
+drop table t1, t2, t3, t4, t5;
+
# End of tests for WL#2486 - natural/using join