mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix for BUG#9622: Make index statistics collection in MyISAM behave the same
way in ALTER TABLE ... ENABLE KEYS, ANALYZE TABLE and after bulk insert: now statistics collection always assumes NULLs are inequal. mysql-test/r/myisam.result: Testcase for BUG#9622 mysql-test/t/myisam.test: Testcase for BUG#9622
This commit is contained in:
@ -581,3 +581,17 @@ check table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
drop table t1;
|
||||
create table t1 (a int, key(a));
|
||||
insert into t1 values (1),(2),(3),(4),(NULL),(NULL),(NULL),(NULL);
|
||||
analyze table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 analyze status OK
|
||||
show keys from t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 1 a 1 a A 8 NULL NULL YES BTREE
|
||||
alter table t1 disable keys;
|
||||
alter table t1 enable keys;
|
||||
show keys from t1;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 1 a 1 a A 8 NULL NULL YES BTREE
|
||||
drop table t1;
|
||||
|
@ -560,3 +560,18 @@ update t1 set c2='A B' where c1=2;
|
||||
check table t1;
|
||||
drop table t1;
|
||||
|
||||
|
||||
# BUG#9622 - ANALYZE TABLE and ALTER TABLE .. ENABLE INDEX produce
|
||||
# different statistics on the same table with NULL values.
|
||||
create table t1 (a int, key(a));
|
||||
|
||||
insert into t1 values (1),(2),(3),(4),(NULL),(NULL),(NULL),(NULL);
|
||||
analyze table t1;
|
||||
show keys from t1;
|
||||
|
||||
alter table t1 disable keys;
|
||||
alter table t1 enable keys;
|
||||
show keys from t1;
|
||||
|
||||
drop table t1;
|
||||
|
||||
|
Reference in New Issue
Block a user