Bug #80503 | optimize MyISAM leads to corrupted index | ||
---|---|---|---|
Submitted: | 25 Feb 2016 5:29 | Modified: | 25 Feb 2016 5:39 |
Reporter: | Fungo Wang (OCA) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: MyISAM storage engine | Severity: | S3 (Non-critical) |
Version: | 5.6.29 | OS: | Red Hat |
Assigned to: | CPU Architecture: | Any | |
Tags: | myisam, Optimize |
[25 Feb 2016 5:29]
Fungo Wang
[25 Feb 2016 5:39]
MySQL Verification Team
Verified as described. Testcase: --- drop table if exists t; create table t (k int,c char(60), key (k))engine=myisam default charset=utf8 row_format=dynamic; set myisam_sort_buffer_size=4096; insert into t(k,c) values(1,repeat('a',60)),(1,repeat('a',60)), (1,repeat('a',60)),(1,repeat('a',60)),(1,repeat('a',60)); insert into t(k,c) select t.k,t.c from t,t a,t b,t c,t d; select count(*) from t; check table t extended; delete from t limit 10; optimize table t; show warnings; check table t extended; ----
[25 Feb 2016 5:39]
MySQL Verification Team
mysql> optimize table t; +--------+----------+----------+--------------------------------------+ | Table | Op | Msg_type | Msg_text | +--------+----------+----------+--------------------------------------+ | test.t | optimize | error | myisam_sort_buffer_size is too small | | test.t | optimize | status | OK | +--------+----------+----------+--------------------------------------+ 2 rows in set (0.01 sec) mysql> show warnings; Empty set (0.00 sec) mysql> check table t extended; +--------+-------+----------+----------------------------------------------+ | Table | Op | Msg_type | Msg_text | +--------+-------+----------+----------------------------------------------+ | test.t | check | error | Record at: 720 Can't find key for index: 1 | | test.t | check | error | Corrupt | +--------+-------+----------+----------------------------------------------+ 2 rows in set (0.00 sec)
[25 Feb 2016 5:41]
MySQL Verification Team
in mysql error log: [Warning] Warning: Optimize table got errno 0 on test.t, retrying [ERROR] Got an error from thread_id=2, ..\..\..\mysql-5.6.29\storage\myisam\ha_myisam.cc:907 [ERROR] MySQL thread id 2, OS thread handle 0xb54, query id 212 localhost ::1 root Checking table