Skip to content

Commit 33d2984

Browse files
committed
MDEV-9683 Server crashes in Item::basic_const_item on numerous nested NULLIFs
test case only
1 parent 70f5fab commit 33d2984

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

mysql-test/r/null.result

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,11 @@ f1
15661566
EXECUTE stmt;
15671567
f1
15681568
DROP TABLE t1;
1569+
CREATE TABLE t1 (i INT);
1570+
INSERT INTO t1 VALUES (1),(2);
1571+
SELECT * FROM t1 WHERE NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(i = ROUND(0), 14), 13), 12), 11), 10), 9), 8), 7), 6), 5), 4), 3), 2), 1);
1572+
i
1573+
DROP TABLE t1;
15691574
#
15701575
# End of 10.1 tests
15711576
#

mysql-test/t/null.test

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,16 @@ PREPARE stmt FROM "SELECT * FROM t1 WHERE NULLIF( ( 1, 2 ) IN ( SELECT 3, 4 ), 1
997997
EXECUTE stmt;
998998
EXECUTE stmt;
999999
DROP TABLE t1;
1000+
1001+
#
1002+
# MDEV-9683 Server crashes in Item::basic_const_item on numerous nested NULLIFs
1003+
#
1004+
CREATE TABLE t1 (i INT);
1005+
INSERT INTO t1 VALUES (1),(2);
1006+
SELECT * FROM t1 WHERE NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(i = ROUND(0), 14), 13), 12), 11), 10), 9), 8), 7), 6), 5), 4), 3), 2), 1);
1007+
DROP TABLE t1;
1008+
1009+
10001010
--echo #
10011011
--echo # End of 10.1 tests
10021012
--echo #

0 commit comments

Comments
 (0)