Wrong cardinality for InnoDB table
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
||||
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.6 |
Triaged
|
Medium
|
Unassigned | |||
5.7 |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Under certain circumstances SHOW INDEXES from InnoDB tables shows wrong cardinality while mysql.innodb_
Test case:
--source include/
create table t1(f1 int, f2 int, key(f1), key f1_2 (f1, f2)) engine=innodb;
insert into t1(f1) values (1),(2)
insert into t1 (f1) select f1 from t1;
insert into t1 (f1) select f1 from t1;
insert into t1 (f1) select f1 from t1;
insert into t1 (f1) select f1 from t1;
insert into t1 (f1) select f1 from t1;
insert into t1 (f1) select f1 from t1;
insert into t1 (f1) select f1 from t1;
update t1 set f2=rand();
analyze table t1;
show indexes from t1;
select count(distinct f1), count(distinct f2), count(distinct f1, f2), count(*) from t1;
select * from mysql.innodb_
alter table t1 engine=myisam;
analyze table t1;
show indexes from t1;
select count(distinct f1), count(distinct f2), count(distinct f1, f2), count(*) from t1;
select * from mysql.innodb_
Bug does not exist in MyISAM and version 5.7
Upstream?