summaryrefslogtreecommitdiff
path: root/mysql-test/t/parser.test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2016-09-13 20:28:58 +0400
committerAlexander Barkov <bar@mariadb.org>2016-09-13 20:28:58 +0400
commita0db19bed9e792314a3a7d4ebc996c76270d5797 (patch)
tree221873be57c49e16ecd797c9a33331f687d47d1e /mysql-test/t/parser.test
parent54b81ac57f89cf38f7166c0691eb78a093d94824 (diff)
downloadmariadb-git-a0db19bed9e792314a3a7d4ebc996c76270d5797.tar.gz
MDEV-10779 Failing assertion lex->proc_list.elements == 0 or syntax error on PROCEDURE ANALYSE in UNION
Reverting a part of the patch for "MDEV-8909union parser cleanup", as a parenthesized SELECT with PROCEDURE followed by UNION is not disallowed by the grammar (only a non-parenthesized SELECT with PROCEDURE followed by a UNION is disallowed grammatically).
Diffstat (limited to 'mysql-test/t/parser.test')
-rw-r--r--mysql-test/t/parser.test48
1 files changed, 48 insertions, 0 deletions
diff --git a/mysql-test/t/parser.test b/mysql-test/t/parser.test
index 90b0fb11648..5970b564c85 100644
--- a/mysql-test/t/parser.test
+++ b/mysql-test/t/parser.test
@@ -1263,3 +1263,51 @@ SELECT a FROM t1 GROUP BY a WITH ROLLUP UNION SELECT 1 ORDER BY a LIMIT 1;
SELECT 1 AS a UNION (SELECT a FROM t1 GROUP BY a WITH ROLLUP LIMIT 2);
(SELECT a FROM t1 GROUP BY a WITH ROLLUP LIMIT 2) UNION SELECT 1;
DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-10779 Failing assertion lex->proc_list.elements == 0 or syntax error on PROCEDURE ANALYSE in UNION
+--echo #
+
+CREATE TABLE t1 (i INT);
+--error ER_WRONG_USAGE
+(SELECT * FROM t1 PROCEDURE ANALYSE(10, 10))
+UNION
+(SELECT * FROM t1 PROCEDURE ANALYSE(10, 10));
+
+--error ER_WRONG_USAGE
+(SELECT * FROM t1 PROCEDURE ANALYSE(10, 10))
+UNION
+SELECT * FROM t1 PROCEDURE ANALYSE(10, 10);
+
+--error ER_WRONG_USAGE
+(SELECT * FROM t1 PROCEDURE ANALYSE(10, 10))
+UNION
+(SELECT 1);
+
+--error ER_WRONG_USAGE
+(SELECT * FROM t1 PROCEDURE ANALYSE(10, 10))
+UNION
+SELECT 1;
+
+--error ER_PARSE_ERROR
+SELECT * FROM t1 PROCEDURE ANALYSE(10, 10)
+UNION
+(SELECT * FROM t1 PROCEDURE ANALYSE(10, 10));
+
+--error ER_PARSE_ERROR
+SELECT * FROM t1 PROCEDURE ANALYSE(10, 10)
+UNION
+SELECT * FROM t1 PROCEDURE ANALYSE(10, 10);
+
+--error ER_PARSE_ERROR
+SELECT * FROM t1 PROCEDURE ANALYSE(10, 10)
+UNION
+(SELECT 1);
+
+--error ER_PARSE_ERROR
+SELECT * FROM t1 PROCEDURE ANALYSE(10, 10)
+UNION
+SELECT 1;
+
+DROP TABLE t1;