From 9aeeba48646cceaf7658cdbb4d9cdf47e6957c02 Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Tue, 30 Sep 2014 21:11:03 +0400 Subject: MDEV-6808: MariaDB 10.0.13 crash with optimizer_use_condition_selectivity > 1 Fix a trivial typo: in table_multi_eq_cond_selectivity(), reset the loop variable between loops. --- mysql-test/r/selectivity_innodb.result | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'mysql-test/r/selectivity_innodb.result') diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result index 90f6dba83f1..96eedc0b415 100644 --- a/mysql-test/r/selectivity_innodb.result +++ b/mysql-test/r/selectivity_innodb.result @@ -1358,4 +1358,39 @@ set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivit DROP TABLE t1,t2; set use_stat_tables=@save_use_stat_tables; set optimizer_switch=@save_optimizer_switch_for_selectivity_test; +# +# MDEV-6808: MariaDB 10.0.13 crash with optimizer_use_condition_selectivity > 1 +# +set @tmp_mdev6808= @@optimizer_use_condition_selectivity; +SET optimizer_use_condition_selectivity = 2; +CREATE TABLE t1 ( +event_id int(11) unsigned NOT NULL AUTO_INCREMENT, +PRIMARY KEY (event_id) +) ENGINE=InnoDB; +CREATE TABLE t2 ( +repost_id int(11) unsigned NOT NULL AUTO_INCREMENT, +subject_type varchar(24) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL, +subject_id int(11) unsigned NOT NULL, +object_type varchar(24) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL, +object_id int(11) unsigned NOT NULL, +is_private int(1) NOT NULL DEFAULT '0', +PRIMARY KEY (repost_id), +UNIQUE KEY `BETWEEN` (subject_type,subject_id,object_type,object_id,is_private), +KEY SUBJECT (subject_type,subject_id), +KEY OBJECT (object_type,object_id) +) ENGINE=InnoDB; +SELECT +* +FROM +t2, t1 +WHERE +t2.object_type = 'event' AND +t2.object_id = t1.event_id AND +t2.is_private = 0 AND +t2.subject_id = 127994 AND +t2.subject_type in ('user') +; +repost_id subject_type subject_id object_type object_id is_private event_id +DROP TABLE t1, t2; +set optimizer_use_condition_selectivity=@tmp_mdev6808; SET SESSION STORAGE_ENGINE=DEFAULT; -- cgit v1.2.1