summaryrefslogtreecommitdiff
path: root/mysql-test/t/subselect.test
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2016-02-08 22:53:40 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2016-02-09 19:02:25 +0200
commit775cccca9f1502ae2f4cf1417d0f94d4872d4630 (patch)
tree8611a9f868e11c3ff9d702da9bb545cbf72d72ef /mysql-test/t/subselect.test
parent01628ce35a241c2bd1a3c2954ee09b6dda961a74 (diff)
downloadmariadb-git-775cccca9f1502ae2f4cf1417d0f94d4872d4630.tar.gz
MDEV-7122: Assertion `0' failed in subselect_hash_sj_engine::init
The select mentioned in the bug attempted to create a temporary table using the maria storage engine. The table needs to have primary keys such that duplicates can be removed. Unfortunately this use case has a longer than allowed key and the tmp table got created without a temporary key. We must not allow materialization for the subquery if the total key length and key parts is greater than what the storage engine supports.
Diffstat (limited to 'mysql-test/t/subselect.test')
-rw-r--r--mysql-test/t/subselect.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 67eac0d228c..b802761aff3 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -5964,3 +5964,13 @@ EXECUTE stmt;
deallocate prepare stmt;
drop table t1,t2,t3,t4;
+
+--echo # MDEV-7122
+--echo # Assertion `0' failed in subselect_hash_sj_engine::init
+--echo #
+SET SESSION big_tables=1;
+CREATE TABLE t1(a char(255) DEFAULT '', KEY(a(10))) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+INSERT INTO t1 VALUES(0),(0),(0);
+SELECT * FROM t1 WHERE a IN(SELECT MIN(a) FROM t1);
+DROP TABLE t1;
+SET SESSION big_tables=0;