diff options
author | evgen@moonbone.local <> | 2007-03-21 21:54:38 +0300 |
---|---|---|
committer | evgen@moonbone.local <> | 2007-03-21 21:54:38 +0300 |
commit | 72bf9b4847349354a269f4341349b36beb38f7fe (patch) | |
tree | 4f651eaf4e0ed6433b9456ee1dcc1314f5430be4 /mysql-test/r/union.result | |
parent | 31b9145ab3de8813a10937f0894d3e127e78533c (diff) | |
download | mariadb-git-72bf9b4847349354a269f4341349b36beb38f7fe.tar.gz |
Bug#23345: Wrongly allowed INTO in a non-last select of a UNION.
INTO clause can be specified only for the last select of a UNION and it
receives the result of the whole query. But it was wrongly allowed in
non-last selects of a UNION which leads to a confusing query result.
Now INTO allowed only in the last select of a UNION.
Diffstat (limited to 'mysql-test/r/union.result')
-rw-r--r-- | mysql-test/r/union.result | 8 |
1 files changed, 8 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 |