Cardinality reset to 0 with persistent statistics when AUTO_INCREMENT touched
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 |
Triaged
|
Medium
|
Unassigned |
Bug Description
Description:
Cardinality reset to 0 with persistent statistics when AUTO_INCREMENT added or removed.
Bug is not repeatable with 8.0
How to repeat:
--source include/
set global innodb_
set global innodb_
show variables like 'innodb_
create table t1(id int not null auto_increment primary key, f1 int, f2 int, f3 int, key(f1), key(f2), key(f3)) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_AUTO_RECALC=0 STATS_SAMPLE_
insert into t1 values(1,1,1,1), (2,2,2,2), (3,3,3,3), (4,4,4,4), (5,5,5,5);
analyze table t1;
show index from t1;
select * from t1;
show index from t1;
alter table t1 modify id int not null;
show index from t1;
analyze table t1;
show index from t1;
alter table t1 modify id int not null auto_increment;
show index from t1;
Suggested fix:
Do not reset cardinality
tags: | added: upstream |
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/ /jira.percona. com/browse/ PS-1777