mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fixed bug in OPTIMIZE TABLE that reset index cardinality if it
was up to date.
This commit is contained in:
@ -10,3 +10,13 @@ Table Op Msg_type Msg_text
|
||||
test.t1 repair status OK
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status OK
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Comment
|
||||
t1 0 PRIMARY 1 a A 5 NULL NULL
|
||||
t1 1 b 1 b A 1 NULL NULL
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status Table is already up to date
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Comment
|
||||
t1 0 PRIMARY 1 a A 5 NULL NULL
|
||||
t1 1 b 1 b A 1 NULL NULL
|
||||
|
@ -36,3 +36,15 @@ check table t1;
|
||||
repair table t1;
|
||||
check table t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test bug: Two optimize in a row reset index cardinality
|
||||
#
|
||||
|
||||
create table t1 (a int not null auto_increment, b int not null, primary key (a), index(b));
|
||||
insert into t1 (b) values (1),(2),(2),(2),(2);
|
||||
optimize table t1;
|
||||
show index from t1;
|
||||
optimize table t1;
|
||||
show index from t1;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user