summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2020-05-19 12:40:59 +0400
committerAlexander Barkov <bar@mariadb.com>2020-05-19 12:40:59 +0400
commitf7079d295ba50b900ec158ba0c54dbafd7fde29e (patch)
tree3ea7362bf99877fec217215551529b02dad5801e
parent810b7f8ecbea0fbf52e03aa710a8059ea301f7dc (diff)
downloadmariadb-git-f7079d295ba50b900ec158ba0c54dbafd7fde29e.tar.gz
MDEV-22610 Crash in INSERT INTO t1 (VALUES (DEFAULT) UNION VALUES (DEFAULT))
The fix for MDEV-21995 earlier fixed MDEV-22610. Adding tests only.
-rw-r--r--mysql-test/main/table_value_constr.result13
-rw-r--r--mysql-test/main/table_value_constr.test16
2 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/main/table_value_constr.result b/mysql-test/main/table_value_constr.result
index 3098edbc1f4..86e8b9cf76d 100644
--- a/mysql-test/main/table_value_constr.result
+++ b/mysql-test/main/table_value_constr.result
@@ -2621,3 +2621,16 @@ EXECUTE IMMEDIATE 'VALUES (?)' USING IGNORE;
ERROR HY000: 'ignore' is not allowed in this context
EXECUTE IMMEDIATE 'VALUES (?)' USING DEFAULT;
ERROR HY000: 'default' is not allowed in this context
+#
+# MDEV-22610 Crash in INSERT INTO t1 (VALUES (DEFAULT) UNION VALUES (DEFAULT))
+#
+VALUES (DEFAULT) UNION VALUES (DEFAULT);
+ERROR HY000: 'default' is not allowed in this context
+VALUES (IGNORE) UNION VALUES (IGNORE);
+ERROR HY000: 'ignore' is not allowed in this context
+CREATE TABLE t1 (a INT DEFAULT 10);
+INSERT INTO t1 (VALUES (DEFAULT) UNION VALUES (DEFAULT));
+ERROR HY000: 'default' is not allowed in this context
+INSERT INTO t1 (VALUES (IGNORE) UNION VALUES (IGNORE));
+ERROR HY000: 'ignore' is not allowed in this context
+DROP TABLE t1;
diff --git a/mysql-test/main/table_value_constr.test b/mysql-test/main/table_value_constr.test
index 11d553f0b85..bd5e4d75904 100644
--- a/mysql-test/main/table_value_constr.test
+++ b/mysql-test/main/table_value_constr.test
@@ -1353,3 +1353,19 @@ VALUES (DEFAULT);
EXECUTE IMMEDIATE 'VALUES (?)' USING IGNORE;
--error ER_UNKNOWN_ERROR
EXECUTE IMMEDIATE 'VALUES (?)' USING DEFAULT;
+
+
+--echo #
+--echo # MDEV-22610 Crash in INSERT INTO t1 (VALUES (DEFAULT) UNION VALUES (DEFAULT))
+--echo #
+
+--error ER_UNKNOWN_ERROR
+VALUES (DEFAULT) UNION VALUES (DEFAULT);
+--error ER_UNKNOWN_ERROR
+VALUES (IGNORE) UNION VALUES (IGNORE);
+CREATE TABLE t1 (a INT DEFAULT 10);
+--error ER_UNKNOWN_ERROR
+INSERT INTO t1 (VALUES (DEFAULT) UNION VALUES (DEFAULT));
+--error ER_UNKNOWN_ERROR
+INSERT INTO t1 (VALUES (IGNORE) UNION VALUES (IGNORE));
+DROP TABLE t1;