Skip to content

Commit f7079d2

Browse files
committed
MDEV-22610 Crash in INSERT INTO t1 (VALUES (DEFAULT) UNION VALUES (DEFAULT))
The fix for MDEV-21995 earlier fixed MDEV-22610. Adding tests only.
1 parent 810b7f8 commit f7079d2

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

mysql-test/main/table_value_constr.result

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2621,3 +2621,16 @@ EXECUTE IMMEDIATE 'VALUES (?)' USING IGNORE;
26212621
ERROR HY000: 'ignore' is not allowed in this context
26222622
EXECUTE IMMEDIATE 'VALUES (?)' USING DEFAULT;
26232623
ERROR HY000: 'default' is not allowed in this context
2624+
#
2625+
# MDEV-22610 Crash in INSERT INTO t1 (VALUES (DEFAULT) UNION VALUES (DEFAULT))
2626+
#
2627+
VALUES (DEFAULT) UNION VALUES (DEFAULT);
2628+
ERROR HY000: 'default' is not allowed in this context
2629+
VALUES (IGNORE) UNION VALUES (IGNORE);
2630+
ERROR HY000: 'ignore' is not allowed in this context
2631+
CREATE TABLE t1 (a INT DEFAULT 10);
2632+
INSERT INTO t1 (VALUES (DEFAULT) UNION VALUES (DEFAULT));
2633+
ERROR HY000: 'default' is not allowed in this context
2634+
INSERT INTO t1 (VALUES (IGNORE) UNION VALUES (IGNORE));
2635+
ERROR HY000: 'ignore' is not allowed in this context
2636+
DROP TABLE t1;

mysql-test/main/table_value_constr.test

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,3 +1353,19 @@ VALUES (DEFAULT);
13531353
EXECUTE IMMEDIATE 'VALUES (?)' USING IGNORE;
13541354
--error ER_UNKNOWN_ERROR
13551355
EXECUTE IMMEDIATE 'VALUES (?)' USING DEFAULT;
1356+
1357+
1358+
--echo #
1359+
--echo # MDEV-22610 Crash in INSERT INTO t1 (VALUES (DEFAULT) UNION VALUES (DEFAULT))
1360+
--echo #
1361+
1362+
--error ER_UNKNOWN_ERROR
1363+
VALUES (DEFAULT) UNION VALUES (DEFAULT);
1364+
--error ER_UNKNOWN_ERROR
1365+
VALUES (IGNORE) UNION VALUES (IGNORE);
1366+
CREATE TABLE t1 (a INT DEFAULT 10);
1367+
--error ER_UNKNOWN_ERROR
1368+
INSERT INTO t1 (VALUES (DEFAULT) UNION VALUES (DEFAULT));
1369+
--error ER_UNKNOWN_ERROR
1370+
INSERT INTO t1 (VALUES (IGNORE) UNION VALUES (IGNORE));
1371+
DROP TABLE t1;

0 commit comments

Comments
 (0)