diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2014-09-30 21:11:03 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2014-09-30 21:11:03 +0400 |
commit | 9aeeba48646cceaf7658cdbb4d9cdf47e6957c02 (patch) | |
tree | 8041a1931ff47779fc6c74dd29754c570fbd3462 /mysql-test/t/selectivity_innodb.test | |
parent | 4630732f258e7ea4db47b0be58c8904d50a21e67 (diff) | |
download | mariadb-git-9aeeba48646cceaf7658cdbb4d9cdf47e6957c02.tar.gz |
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.
Diffstat (limited to 'mysql-test/t/selectivity_innodb.test')
-rw-r--r-- | mysql-test/t/selectivity_innodb.test | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/mysql-test/t/selectivity_innodb.test b/mysql-test/t/selectivity_innodb.test index 6b67e2d0529..6996a6dd7ed 100644 --- a/mysql-test/t/selectivity_innodb.test +++ b/mysql-test/t/selectivity_innodb.test @@ -9,4 +9,41 @@ set optimizer_switch='extended_keys=on'; set optimizer_switch=@save_optimizer_switch_for_selectivity_test; +--echo # +--echo # MDEV-6808: MariaDB 10.0.13 crash with optimizer_use_condition_selectivity > 1 +--echo # +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') +; +DROP TABLE t1, t2; +set optimizer_use_condition_selectivity=@tmp_mdev6808; + SET SESSION STORAGE_ENGINE=DEFAULT; |