Commit 4d32be13 authored by Bernt M. Johnsen's avatar Bernt M. Johnsen

Bug#43329 prepared for commit on 5.0

parent 81e4e1e7
...@@ -1447,12 +1447,12 @@ SELECT a FROM t1 ...@@ -1447,12 +1447,12 @@ SELECT a FROM t1
UNION UNION
SELECT a FROM t1 SELECT a FROM t1
) alias; ) alias;
SELECT a INTO OUTFILE 'union.out.file' FROM ( SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM (
SELECT a FROM t1 SELECT a FROM t1
UNION UNION
SELECT a FROM t1 WHERE 0 SELECT a FROM t1 WHERE 0
) alias; ) alias;
SELECT a INTO DUMPFILE 'union.out.file2' FROM ( SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM (
SELECT a FROM t1 SELECT a FROM t1
UNION UNION
SELECT a FROM t1 WHERE 0 SELECT a FROM t1 WHERE 0
...@@ -1465,21 +1465,21 @@ SELECT a INTO @v FROM t1 ...@@ -1465,21 +1465,21 @@ SELECT a INTO @v FROM t1
SELECT a FROM ( SELECT a FROM (
SELECT a FROM t1 SELECT a FROM t1
UNION UNION
SELECT a INTO OUTFILE 'union.out.file3' FROM t1 SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1
) alias; ) alias;
SELECT a FROM ( SELECT a FROM (
SELECT a FROM t1 SELECT a FROM t1
UNION UNION
SELECT a INTO DUMPFILE 'union.out.file4' FROM t1 SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1
) alias; ) alias;
SELECT a FROM t1 UNION SELECT a INTO @v FROM t1; SELECT a FROM t1 UNION SELECT a INTO @v FROM t1;
SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file5' FROM t1; SELECT a FROM t1 UNION SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1;
SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file6' FROM t1; SELECT a FROM t1 UNION SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1;
SELECT a INTO @v FROM t1 UNION SELECT a FROM t1; SELECT a INTO @v FROM t1 UNION SELECT a FROM t1;
ERROR HY000: Incorrect usage of UNION and INTO ERROR HY000: Incorrect usage of UNION and INTO
SELECT a INTO OUTFILE 'union.out.file7' FROM t1 UNION SELECT a FROM t1; SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1 UNION SELECT a FROM t1;
ERROR HY000: Incorrect usage of UNION and INTO ERROR HY000: Incorrect usage of UNION and INTO
SELECT a INTO DUMPFILE 'union.out.file8' FROM t1 UNION SELECT a FROM t1; SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1 UNION SELECT a FROM t1;
ERROR HY000: Incorrect usage of UNION and INTO ERROR HY000: Incorrect usage of UNION and INTO
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a INT); CREATE TABLE t1 (a INT);
......
...@@ -933,17 +933,25 @@ SELECT a INTO @v FROM ( ...@@ -933,17 +933,25 @@ SELECT a INTO @v FROM (
SELECT a FROM t1 SELECT a FROM t1
) alias; ) alias;
SELECT a INTO OUTFILE 'union.out.file' FROM ( --let $outfile = $MYSQLTEST_VARDIR/tmp/union.out.file
--error 0,1
--remove_file $outfile
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval SELECT a INTO OUTFILE '$outfile' FROM (
SELECT a FROM t1 SELECT a FROM t1
UNION UNION
SELECT a FROM t1 WHERE 0 SELECT a FROM t1 WHERE 0
) alias; ) alias;
--remove_file $outfile
SELECT a INTO DUMPFILE 'union.out.file2' FROM ( --replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval SELECT a INTO DUMPFILE '$outfile' FROM (
SELECT a FROM t1 SELECT a FROM t1
UNION UNION
SELECT a FROM t1 WHERE 0 SELECT a FROM t1 WHERE 0
) alias; ) alias;
--remove_file $outfile
# #
# INTO will not be allowed in subqueries in version 5.1 and above. # INTO will not be allowed in subqueries in version 5.1 and above.
...@@ -954,27 +962,42 @@ SELECT a FROM ( ...@@ -954,27 +962,42 @@ SELECT a FROM (
SELECT a INTO @v FROM t1 SELECT a INTO @v FROM t1
) alias; ) alias;
SELECT a FROM ( --replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval SELECT a FROM (
SELECT a FROM t1 SELECT a FROM t1
UNION UNION
SELECT a INTO OUTFILE 'union.out.file3' FROM t1 SELECT a INTO OUTFILE '$outfile' FROM t1
) alias; ) alias;
--remove_file $outfile
SELECT a FROM ( --replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval SELECT a FROM (
SELECT a FROM t1 SELECT a FROM t1
UNION UNION
SELECT a INTO DUMPFILE 'union.out.file4' FROM t1 SELECT a INTO DUMPFILE '$outfile' FROM t1
) alias; ) alias;
--remove_file $outfile
SELECT a FROM t1 UNION SELECT a INTO @v FROM t1; SELECT a FROM t1 UNION SELECT a INTO @v FROM t1;
SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file5' FROM t1;
SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file6' FROM t1; --replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval SELECT a FROM t1 UNION SELECT a INTO OUTFILE '$outfile' FROM t1;
--remove_file $outfile
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval SELECT a FROM t1 UNION SELECT a INTO DUMPFILE '$outfile' FROM t1;
--remove_file $outfile
--error ER_WRONG_USAGE --error ER_WRONG_USAGE
SELECT a INTO @v FROM t1 UNION SELECT a FROM t1; SELECT a INTO @v FROM t1 UNION SELECT a FROM t1;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
--error ER_WRONG_USAGE --error ER_WRONG_USAGE
SELECT a INTO OUTFILE 'union.out.file7' FROM t1 UNION SELECT a FROM t1; eval SELECT a INTO OUTFILE '$outfile' FROM t1 UNION SELECT a FROM t1;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
--error ER_WRONG_USAGE --error ER_WRONG_USAGE
SELECT a INTO DUMPFILE 'union.out.file8' FROM t1 UNION SELECT a FROM t1; eval SELECT a INTO DUMPFILE '$outfile' FROM t1 UNION SELECT a FROM t1;
DROP TABLE t1; DROP TABLE t1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment