summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-11-18 14:08:17 +0200
committermonty@hundin.mysql.fi <>2001-11-18 14:08:17 +0200
commitfb1f8c4f0a6f5df43d033b52d8d804cd540cb43c (patch)
tree3d0563b3a96cfaa7e8b9b687efcb6f1407f7f58b /mysql-test
parent7c7795210610cecb632aedaf432cae3e5cb344fb (diff)
downloadmariadb-git-fb1f8c4f0a6f5df43d033b52d8d804cd540cb43c.tar.gz
Fixed bug in OPTIMIZE TABLE that reset index cardinality if it
was up to date.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/myisam.result10
-rw-r--r--mysql-test/t/myisam.test12
2 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 1152ca24f38..143802a4d05 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -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
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 0dc7f84efc5..5b483b969bc 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -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;