diff options
author | Igor Babaev <igor@askmonty.org> | 2013-04-05 13:01:46 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2013-04-05 13:01:46 -0700 |
commit | 503731d80f732a3a790443cc530fea2c3721b869 (patch) | |
tree | 25387182582cd5d2e53913a567dbde17b2907cae /mysql-test/r/selectivity_innodb.result | |
parent | daaa5834c9fb567924c21d467983c1ec3401f832 (diff) | |
download | mariadb-git-503731d80f732a3a790443cc530fea2c3721b869.tar.gz |
Fixed bug mdev-4371.
Avoid possible division by 0.
Diffstat (limited to 'mysql-test/r/selectivity_innodb.result')
-rw-r--r-- | mysql-test/r/selectivity_innodb.result | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result index 256b93d8cb5..6d0c8434051 100644 --- a/mysql-test/r/selectivity_innodb.result +++ b/mysql-test/r/selectivity_innodb.result @@ -829,6 +829,35 @@ DROP TABLE t1; set histogram_size=@save_histogram_size; set histogram_type=@save_histogram_type; set use_stat_tables=@save_use_stat_tables; +# +# Bug mdev-4371: Join with condition supported by index on an empty table +# with optimizer_use_condition_selectivity=3 +# +set use_stat_tables=PREFERABLY; +CREATE TABLE t1 (a int, b int, INDEX(a)); +CREATE TABLE t2 (c int); +INSERT INTO t2 VALUES (1),(2),(3),(4),(5),(6),(7),(8); +ANALYZE TABLE t1, t2; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +FLUSH TABLES; +set optimizer_use_condition_selectivity=3; +set @save_optimizer_switch=@@optimizer_switch; +set optimizer_switch='index_condition_pushdown=off'; +EXPLAIN EXTENDED +SELECT * FROM t1, t2 WHERE a > 9; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 range a a 5 NULL 1 0.00 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using join buffer (flat, BNL join) +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` > 9) +SELECT * FROM t1, t2 WHERE a > 9; +a b c +set optimizer_switch=@save_optimizer_switch; +set optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity; +DROP TABLE t1,t2; +set use_stat_tables=@save_use_stat_tables; set use_stat_tables=@save_use_stat_tables; set optimizer_switch=@save_optimizer_switch_for_selectivity_test; SET SESSION STORAGE_ENGINE=DEFAULT; |