summaryrefslogtreecommitdiff
path: root/mysql-test/t/selectivity.test
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2014-02-11 19:22:17 -0800
committerIgor Babaev <igor@askmonty.org>2014-02-11 19:22:17 -0800
commit80a38b92d41ed034598c4064669fcd6f4d28f3ee (patch)
tree14d0b1a19f7b4118763bd6244739da8550d1b1ad /mysql-test/t/selectivity.test
parent50323f12630fbc5b19b40f1a9affdc550cc7cfd9 (diff)
downloadmariadb-git-80a38b92d41ed034598c4064669fcd6f4d28f3ee.tar.gz
Fixed bug mdev-5630.
The function calculate_cond_selectivity_for_table() must consider the case when the key range tree returned by the call of get_mm_tree() is of the type SEL_TREE::ALWAYS.
Diffstat (limited to 'mysql-test/t/selectivity.test')
-rw-r--r--mysql-test/t/selectivity.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/t/selectivity.test b/mysql-test/t/selectivity.test
index 82baf7cf1af..fe804cf459f 100644
--- a/mysql-test/t/selectivity.test
+++ b/mysql-test/t/selectivity.test
@@ -750,3 +750,25 @@ SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE SQL_MODE != '';
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
+--echo #
+--echo # Bug mdev-5630: always true conjunctive condition
+--echo # when optimizer_use_condition_selectivity=3
+--echo #
+
+set use_stat_tables = 'preferably';
+set optimizer_use_condition_selectivity = 3;
+
+CREATE TABLE t1 (a int) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (10);
+
+CREATE TABLE t2 (id int, flag char(1), INDEX(id)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (100,'0'),(101,'1');
+
+ANALYZE TABLE t1, t2;
+
+SELECT * FROM t1, t2 WHERE id = a AND ( a = 16 OR flag AND a != 6 );
+
+DROP TABLE t1,t2;
+
+set use_stat_tables=@save_use_stat_tables;
+