summaryrefslogtreecommitdiff
path: root/mysql-test/suite/heap/heap.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/heap/heap.test')
-rw-r--r--mysql-test/suite/heap/heap.test53
1 files changed, 53 insertions, 0 deletions
diff --git a/mysql-test/suite/heap/heap.test b/mysql-test/suite/heap/heap.test
index ef2527beeb0..1d934bec0fd 100644
--- a/mysql-test/suite/heap/heap.test
+++ b/mysql-test/suite/heap/heap.test
@@ -510,6 +510,59 @@ DELETE FROM t1 WHERE ts = 1 AND color = 'GREEN';
SELECT * from t1;
DROP TABLE t1;
+
+#
+# MDEV-5905 Creating tmp. memory table kills the server
+#
+
+CREATE TABLE t1 (id INT);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t1 VALUES (2);
+
+--disable_warnings
+SET @@max_heap_table_size = 1024*1024*1024*20;
+--enable_warnings
+
+CREATE TEMPORARY TABLE tmp ENGINE=MEMORY
+ SELECT id FROM t1;
+DROP TEMPORARY TABLE tmp;
+drop table t1;
+
+--echo #
+--echo # BUG#11825482: Broken key length calculation for btree index
+--echo #
+CREATE TABLE h1 (f1 VARCHAR(1), f2 INT NOT NULL,
+ UNIQUE KEY h1i (f1,f2) USING BTREE ) ENGINE=HEAP;
+INSERT INTO h1 VALUES(NULL,0),(NULL,1);
+SELECT 'wrong' as 'result' FROM dual WHERE ('h', 0) NOT IN (SELECT * FROM h1);
+
+CREATE TABLE t1 (
+ pk int NOT NULL,
+ col_int_nokey INT,
+ col_varchar_nokey VARCHAR(1),
+ PRIMARY KEY (pk)
+);
+
+INSERT INTO t1 VALUES (19,5,'h'),(20,5,'h');
+
+CREATE TABLE t2 (col_int_nokey INT);
+
+INSERT INTO t2 VALUES (1),(2);
+
+CREATE VIEW v1 AS
+ SELECT col_varchar_nokey, COUNT( col_varchar_nokey )
+ FROM t1
+ WHERE col_int_nokey <= 141 AND pk <= 4
+;
+
+SELECT col_int_nokey FROM t2
+WHERE ('h', 0) NOT IN ( SELECT * FROM v1);
+--echo # shouldn't crash
+EXPLAIN SELECT col_int_nokey FROM t2
+WHERE ('h', 0) NOT IN ( SELECT * FROM v1);
+
+DROP TABLE t1,t2,h1;
+DROP VIEW v1;
# End of 5.1 tests
#