summaryrefslogtreecommitdiff
path: root/mysql-test/t/selectivity.test
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2016-10-26 10:59:38 -0700
committerIgor Babaev <igor@askmonty.org>2016-10-26 20:45:35 -0700
commitd451d772fdaa554eeb96ae12f96c3a32a6fd4d66 (patch)
treeddd2e464baa0afe8b79569ff95b603941d7168d1 /mysql-test/t/selectivity.test
parent9d4a0dde0ae3e0d46b4c5c0967c25862d467e94e (diff)
downloadmariadb-git-d451d772fdaa554eeb96ae12f96c3a32a6fd4d66.tar.gz
Fixed bug mdev-9628.
In the function create_key_parts_for_pseudo_indexes() the key part structures of pseudo-indexes created for BLOB fields were set incorrectly. Also the key parts for long fields must be 'truncated' up to the maximum length acceptable for key parts.
Diffstat (limited to 'mysql-test/t/selectivity.test')
-rw-r--r--mysql-test/t/selectivity.test33
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/t/selectivity.test b/mysql-test/t/selectivity.test
index 1321046009e..8efc5216ba0 100644
--- a/mysql-test/t/selectivity.test
+++ b/mysql-test/t/selectivity.test
@@ -992,3 +992,36 @@ drop table t1;
set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;
+--echo #
+--echo # Bug mdev-9628: unindexed blob column without min-max statistics
+--echo # with optimizer_use_condition_selectivity=3
+--echo #
+
+set use_stat_tables='preferably';
+set optimizer_use_condition_selectivity=3;
+
+create table t1(col1 char(32));
+insert into t1 values ('a'),('b'),('c'),('d'), ('e'),('f'),('g'),('h');
+analyze table t1;
+
+create table t2(col1 text);
+insert into t2 values ('a'),('b'),('c'),('d'), ('e'),('f'),('g'),('h');
+analyze table t2;
+
+select * from t1 where col1 > 'b' and col1 < 'd';
+explain extended
+select * from t1 where col1 > 'b' and col1 < 'd';
+
+select * from t2 where col1 > 'b' and col1 < 'd';
+explain extended
+select * from t2 where col1 > 'b' and col1 < 'd';
+
+select * from t2 where col1 < 'b' and col1 > 'd';
+explain extended
+select * from t2 where col1 < 'b' and col1 > 'd';
+
+drop table t1,t2;
+
+set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
+set use_stat_tables=@save_use_stat_tables;
+