summaryrefslogtreecommitdiff
path: root/mysql-test/main
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main')
-rw-r--r--mysql-test/main/derived.result28
-rw-r--r--mysql-test/main/derived.test24
2 files changed, 52 insertions, 0 deletions
diff --git a/mysql-test/main/derived.result b/mysql-test/main/derived.result
index 112a72a2bf6..b5b4341ce5e 100644
--- a/mysql-test/main/derived.result
+++ b/mysql-test/main/derived.result
@@ -1476,5 +1476,33 @@ a
2
drop table t1;
#
+# MDEV-31022: SIGSEGV in maria_create from create_internal_tmp_table
+# keydef incorrectly allocated on the stack in create_internal_tmp_table()
+#
+CREATE TABLE t1 (c CHAR(1) NULL) ENGINE=MyISAM;
+INSERT INTO t1 (c) VALUES (1);
+SET statement
+optimizer_where_cost=1,
+big_tables=1,
+in_predicate_conversion_threshold=2
+FOR
+SELECT * FROM t1 WHERE c IN ('','');
+c
+Warnings:
+Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
+Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
+SET statement
+optimizer_where_cost=1,
+big_tables=1,
+in_predicate_conversion_threshold=2,
+sql_mode=''
+FOR
+SELECT * FROM t1 WHERE c IN ('','');
+c
+Warnings:
+Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
+Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
+DROP TABLE t1;
+#
# End of 11.0 tests
#
diff --git a/mysql-test/main/derived.test b/mysql-test/main/derived.test
index e5f01e15821..b26472d41c0 100644
--- a/mysql-test/main/derived.test
+++ b/mysql-test/main/derived.test
@@ -1244,5 +1244,29 @@ SELECT a FROM t1 WHERE a IN ( 1, 1, 2, 194 );
drop table t1;
--echo #
+--echo # MDEV-31022: SIGSEGV in maria_create from create_internal_tmp_table
+--echo # keydef incorrectly allocated on the stack in create_internal_tmp_table()
+--echo #
+
+CREATE TABLE t1 (c CHAR(1) NULL) ENGINE=MyISAM;
+INSERT INTO t1 (c) VALUES (1);
+SET statement
+ optimizer_where_cost=1,
+ big_tables=1,
+ in_predicate_conversion_threshold=2
+FOR
+SELECT * FROM t1 WHERE c IN ('','');
+
+SET statement
+ optimizer_where_cost=1,
+ big_tables=1,
+ in_predicate_conversion_threshold=2,
+ sql_mode=''
+FOR
+SELECT * FROM t1 WHERE c IN ('','');
+
+DROP TABLE t1;
+
+--echo #
--echo # End of 11.0 tests
--echo #