From e0aadfd491700fc072ffee1e1612f52fa5fc39b1 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Fri, 12 Mar 2010 14:43:30 +0400 Subject: BUG#47444 - --myisam_repair_threads>1can result in all index cardinalities=1 Parallel repair didn't poroperly update index cardinality in certain cases. When myisam_sort_buffer_size is not enough to store all keys, index cardinality was updated before index was actually written, when no index statistic is available. mysql-test/r/myisam.result: A test case for BUG#47444. mysql-test/t/myisam.test: A test case for BUG#47444. storage/myisam/sort.c: update_key_parts() must be called after all index entries are written, when index statistic is available. --- mysql-test/t/myisam.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mysql-test/t/myisam.test') diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 7dcfe058039..4abd7dd2b1b 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1631,4 +1631,18 @@ INSERT INTO t1 VALUES('1'); SELECT * FROM t1, t1 AS a1 WHERE t1.a=1 AND a1.a=1; DROP TABLE t1; +--echo # +--echo # BUG#47444 - --myisam_repair_threads>1can result in all index +--echo # cardinalities=1 +--echo # +SET myisam_repair_threads=2; +SET myisam_sort_buffer_size=4096; +CREATE TABLE t1(a CHAR(255), KEY(a), KEY(a), KEY(a)); +INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(0),(1),(2),(3); +REPAIR TABLE t1; +SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'; +DROP TABLE t1; +SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; +SET myisam_repair_threads=@@global.myisam_repair_threads; + --echo End of 5.1 tests -- cgit v1.2.1