diff options
author | Igor Babaev <igor@askmonty.org> | 2016-10-24 10:15:11 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2016-10-26 20:45:35 -0700 |
commit | 9d4a0dde0ae3e0d46b4c5c0967c25862d467e94e (patch) | |
tree | 51da4792c18533900c08cfb9b07d3bd12af97819 /mysql-test/r/selectivity.result | |
parent | 26b87c332ff78a7aca04930ad86fbf7acc793222 (diff) | |
download | mariadb-git-9d4a0dde0ae3e0d46b4c5c0967c25862d467e94e.tar.gz |
Fixed bug mdev-11096.
1. When min/max value is provided the null flag for it must be set to 0
in the bitmap Culumn_statistics::column_stat_nulls.
2. When the calculation of the selectivity of the range condition
over a column requires min and max values for the column then we
have to check that these values are provided.
Diffstat (limited to 'mysql-test/r/selectivity.result')
-rw-r--r-- | mysql-test/r/selectivity.result | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/r/selectivity.result b/mysql-test/r/selectivity.result index 620bdc6bd50..c2364e11ceb 100644 --- a/mysql-test/r/selectivity.result +++ b/mysql-test/r/selectivity.result @@ -1446,3 +1446,27 @@ a b i set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; DROP TABLE t1,t2; set use_stat_tables=@save_use_stat_tables; +# +# Bug mdev-11096: range condition over column without statistical data +# +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 persistent for columns () indexes (); +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze status OK +explain extended +select * from t1 where col1 > 'b' and col1 < 'e'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 8 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`col1` AS `col1` from `test`.`t1` where ((`test`.`t1`.`col1` > 'b') and (`test`.`t1`.`col1` < 'e')) +select * from t1 where col1 > 'b' and col1 < 'e'; +col1 +c +d +drop table t1; +set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; +set use_stat_tables=@save_use_stat_tables; |