summaryrefslogtreecommitdiff
path: root/mysql-test/t/insert_select.test
diff options
context:
space:
mode:
authorgkodinov@mysql.com <>2006-06-19 17:34:12 +0300
committergkodinov@mysql.com <>2006-06-19 17:34:12 +0300
commit5508df251f4ba04182233ff920e1a14f55a223f4 (patch)
tree6b13b3f10b8d0472a62afabf0b18bc17897740ed /mysql-test/t/insert_select.test
parent92b4a73a203af73788a858cd26efe3ac183615cb (diff)
downloadmariadb-git-5508df251f4ba04182233ff920e1a14f55a223f4.tar.gz
Bug #18080: INSERT ... SELECT ... JOIN results in ambiguous field list error
There was an incomplete reset of the name resolution context, that caused INSERT ... SELECT ... JOIN statements to resolve not by joint row type calculated for the join. Removed the redundant re-initialization of the context, because mysql_insert_select_prepare() now correctly saves/restores the context.
Diffstat (limited to 'mysql-test/t/insert_select.test')
-rw-r--r--mysql-test/t/insert_select.test9
1 files changed, 9 insertions, 0 deletions
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test
index 5dd6f338865..0e1d48fe9f5 100644
--- a/mysql-test/t/insert_select.test
+++ b/mysql-test/t/insert_select.test
@@ -225,3 +225,12 @@ insert into t1(x,y) select x,z from t2 on duplicate key update x=values(t2.x);
drop table t1,t2;
# End of 4.1 tests
+
+#
+# Bug #18080: INSERT ... SELECT ... JOIN results in ambiguous field list error
+#
+CREATE TABLE t1 (x int, y int);
+CREATE TABLE t2 (z int, y int);
+CREATE TABLE t3 (a int, b int);
+INSERT INTO t3 (SELECT x, y FROM t1 JOIN t2 USING (y) WHERE z = 1);
+DROP TABLE IF EXISTS t1,t2,t3;