summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2007-03-21 22:10:33 +0300
committerunknown <evgen@moonbone.local>2007-03-21 22:10:33 +0300
commitb70693f5825f0500cf7e519d7eac7759d4482a18 (patch)
tree393ca0297a1de2b6f25fe68a3f1f858231ed2c40 /mysql-test
parent2fd6320136c3f44e001780e7892819a2f80c73ea (diff)
parent16404523645b8f396ebaea9da5dfa4c453056d06 (diff)
downloadmariadb-git-b70693f5825f0500cf7e519d7eac7759d4482a18.tar.gz
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into moonbone.local:/mnt/gentoo64/work/23345-bug-5.0-opt-mysql
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/union.result8
-rw-r--r--mysql-test/t/union.test9
2 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 9861b1bffeb..8219d68a681 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -1381,4 +1381,12 @@ a
SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY c) AS test;
ERROR 42S22: Unknown column 'c' in 'order clause'
DROP TABLE t1;
+(select 1 into @var) union (select 1);
+ERROR HY000: Incorrect usage of UNION and INTO
+(select 1) union (select 1 into @var);
+select @var;
+@var
+1
+(select 2) union (select 1 into @var);
+ERROR 42000: Result consisted of more than one row
End of 5.0 tests
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index 29a9ee36481..22f09466b1c 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -868,4 +868,13 @@ SELECT a FROM (SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY c) AS test;
DROP TABLE t1;
+#
+# Bug#23345: Wrongly allowed INTO in a non-last select of a UNION.
+#
+--error 1221
+(select 1 into @var) union (select 1);
+(select 1) union (select 1 into @var);
+select @var;
+--error 1172
+(select 2) union (select 1 into @var);
--echo End of 5.0 tests