diff options
author | Igor Babaev <igor@askmonty.org> | 2014-10-28 22:31:52 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2014-10-28 22:31:52 -0700 |
commit | 100b10d8efbcbc936d742b87aacf49dab037333f (patch) | |
tree | 33cd992dc65d7bd5d585f09169d1f14ac5929f53 /mysql-test/r/selectivity_innodb.result | |
parent | 2d088e265ce3ca0523846ec97c7b3b2c4e6cba67 (diff) | |
download | mariadb-git-100b10d8efbcbc936d742b87aacf49dab037333f.tar.gz |
Fixed bug mdev-6843.
The function get_column_range_cardinality() returned a wrong result for any column
containing only null values.
Diffstat (limited to 'mysql-test/r/selectivity_innodb.result')
-rw-r--r-- | mysql-test/r/selectivity_innodb.result | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result index af9c31afae1..c4c398a9ff6 100644 --- a/mysql-test/r/selectivity_innodb.result +++ b/mysql-test/r/selectivity_innodb.result @@ -1390,6 +1390,34 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ref a a 5 test.t1.a 10 100.00 Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` straight_join `test`.`t2` where ((`test`.`t2`.`a` = `test`.`t1`.`a`) and (`test`.`t1`.`a` < 10)) +set histogram_size=@save_histogram_size; +set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; +drop table t0,t1,t2; +# +# Bug mdev-6843: col IS NULL in where condition when col is always NULL +# +create table t0(a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1(a int); +insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C; +create table t2 (a int, b int); +insert into t2 select NULL, a from t1; +set use_stat_tables='preferably'; +set histogram_size=100; +set optimizer_use_condition_selectivity=4; +analyze table t2 persistent for all; +Table Op Msg_type Msg_text +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK +explain extended +select * from t2 A straight_join t2 B where A.a is null; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE A ALL NULL NULL NULL NULL 1000 100.00 Using where +1 SIMPLE B ALL NULL NULL NULL NULL 1000 100.00 Using join buffer (flat, BNL join) +Warnings: +Note 1003 select `test`.`A`.`a` AS `a`,`test`.`A`.`b` AS `b`,`test`.`B`.`a` AS `a`,`test`.`B`.`b` AS `b` from `test`.`t2` `A` straight_join `test`.`t2` `B` where isnull(`test`.`A`.`a`) +set histogram_size=@save_histogram_size; +set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; drop table t0,t1,t2; set use_stat_tables=@save_use_stat_tables; set optimizer_switch=@save_optimizer_switch_for_selectivity_test; |