1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-5980: EITS: if condition is used for REF access, its selectivity is still in filtered%

- Testcase. The bug is fixed by commit for MDEV-6003
This commit is contained in:
Sergey Petrunya
2014-04-25 19:12:06 +04:00
parent 2acd81af73
commit 54265c5f50
2 changed files with 43 additions and 0 deletions

View File

@ -103,6 +103,23 @@ explain extended select * from t2 where a in (1,2,3) and b in (1,2,3);
drop table t2, t1;
--echo #
--echo # MDEV-5980: EITS: if condition is used for REF access, its selectivity is still in filtered%
--echo #
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1(key1 int, col1 int, key(key1));
insert into t1 select A.a, A.a from t0 A, t0 B, t0 C;
set histogram_size=100;
set use_stat_tables='preferably';
set optimizer_use_condition_selectivity=4;
analyze table t1 persistent for all;
--echo # 10% is ok
explain extended select * from t1 where col1=2;
--echo # Must show 100%, not 10%
explain extended select * from t1 where key1=2;
drop table t0, t1;
--echo # MDEV-6003: EITS: ref access, keypart2=const vs keypart2=expr - inconsistent filtered% value
--echo #
create table t0(a int);