summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorVarun Gupta <varunraiko1803@gmail.com>2018-03-06 19:59:57 +0530
committerVarun Gupta <varunraiko1803@gmail.com>2018-03-11 16:17:14 +0530
commit926edd48e1e67bf9a315b3602638a76c4c445ef6 (patch)
tree477fc7e57cfdff94e27b70fc6e8706bc977f377b /mysql-test/r
parentac3fd5acac6b3717ce206e3e9ebf78204af06861 (diff)
downloadmariadb-git-926edd48e1e67bf9a315b3602638a76c4c445ef6.tar.gz
MDEV-15235: Assertion `length > 0' failed in create_ref_for_key
The issue is that we are creating a materialised table with key of length 0 which is incorrect, we should disable materialisation for such a case.
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/subselect_mat.result15
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/subselect_mat.result b/mysql-test/r/subselect_mat.result
index d4dc519227b..00448ac4f91 100644
--- a/mysql-test/r/subselect_mat.result
+++ b/mysql-test/r/subselect_mat.result
@@ -2642,3 +2642,18 @@ a b sq
4 4 1
4 2 1
drop table t1, t2;
+#
+# MDEV-15235: Assertion `length > 0' failed in create_ref_for_key
+#
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (f CHAR(1));
+INSERT INTO t2 VALUES ('a'),('b');
+explain
+SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2
+SELECT * FROM t2 WHERE f IN ( SELECT LEFT('foo',0) FROM t1 ORDER BY 1 );
+f
+DROP TABLE t1, t2;