summaryrefslogtreecommitdiff
path: root/mysql-test/r/innodb_mrr_cpk.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/innodb_mrr_cpk.result')
-rw-r--r--mysql-test/r/innodb_mrr_cpk.result23
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/r/innodb_mrr_cpk.result b/mysql-test/r/innodb_mrr_cpk.result
index 15ef32447a8..bcee428bc57 100644
--- a/mysql-test/r/innodb_mrr_cpk.result
+++ b/mysql-test/r/innodb_mrr_cpk.result
@@ -171,3 +171,26 @@ a b c d e g
2 6 two 12 2 6
DROP TABLE t1, t2;
set optimizer_switch=@tmp_mdev3817;
+#
+# MDEV-5037: Server crash on a JOIN on a derived table with join_cache_level > 2
+#
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+CREATE TABLE t1 (
+id char(8) CHARACTER SET utf8 NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+CREATE TABLE t2 (
+id char(8) CHARACTER SET utf8 DEFAULT NULL,
+url text CHARACTER SET utf8
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+insert into t1 select '03b2ca8c' from t0 A, t0 B limit 80;
+insert into t2 select '03b2ca8c','' from t0 A, t0 B, t0 C;
+set @tmp_mdev5037=@@join_cache_level;
+set join_cache_level=3;
+explain SELECT 1 FROM (SELECT url, id FROM t2 LIMIT 1 OFFSET 20) derived RIGHT JOIN t1 ON t1.id = derived.id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL #
+1 PRIMARY <derived2> hash_ALL key0 #hash#key0 25 test.t1.id # Using join buffer (flat, BNLH join)
+2 DERIVED t2 ALL NULL NULL NULL NULL #
+set join_cache_level= @tmp_mdev5037;
+drop table t0,t1,t2;