summaryrefslogtreecommitdiff
path: root/mysql-test/t/derived_opt.test
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2014-10-29 01:46:05 +0300
committerSergey Petrunya <psergey@askmonty.org>2014-10-29 01:46:05 +0300
commita8341dfd6e001faa0b3b0227650eea6721316f04 (patch)
tree90dfa6bb1a399cd700c66201bb4033e67b5fc3b6 /mysql-test/t/derived_opt.test
parent9cb002b359ca8281cd30b711690dd589a254db4e (diff)
downloadmariadb-git-a8341dfd6e001faa0b3b0227650eea6721316f04.tar.gz
MDEV-6879: Dereference of NULL primary_file->table in DsMrr_impl::get_disk_sweep_mrr_cost()
(Backport to 5.3) (Attempt #2) - Don't attempt to use BKA for materialized derived tables. The table is neither filled nor fully opened yet, so attempt to call handler->multi_range_read_info() causes crash.
Diffstat (limited to 'mysql-test/t/derived_opt.test')
-rw-r--r--mysql-test/t/derived_opt.test29
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/t/derived_opt.test b/mysql-test/t/derived_opt.test
index 4bb1db0b4f6..7f19553e4e5 100644
--- a/mysql-test/t/derived_opt.test
+++ b/mysql-test/t/derived_opt.test
@@ -334,5 +334,34 @@ set join_cache_level=@tmp_jcl;
set optimizer_switch=@tmp_os;
+--echo #
+--echo # MDEV-6879: Dereference of NULL primary_file->table in DsMrr_impl::get_disk_sweep_mrr_cost()
+--echo #
+create table t1(a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t2 (a int, b int, c text);
+insert into t2
+select
+ A.a + B.a* 10,
+ A.a + B.a* 10,
+ 'blob-data'
+from t1 A, t1 B;
+
+set @tmp_jcl= @@join_cache_level;
+set @tmp_os= @@optimizer_switch;
+set join_cache_level=6;
+set @@optimizer_switch='derived_merge=on,derived_with_keys=on,mrr=on';
+explain
+select * from
+ t1 join
+ (select * from t2 order by a limit 1000) as D1
+where
+ D1.a= t1.a;
+
+set join_cache_level=@tmp_jcl;
+set optimizer_switch=@tmp_os;
+drop table t1, t2;
+
# The following command must be the last one the file
set optimizer_switch=@exit_optimizer_switch;