Bug #9188 Corruption Can't open file: 'table.MYI' (errno: 145)
Submitted: 15 Mar 2005 10:46 Modified: 28 Apr 2005 1:27
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1.9, 4.1.10, 4.1.10a OS:Solaris (Solaris 8 64-bit, Win2003)
Assigned to: Ingo Strüwing CPU Architecture:Any
Tags: corruption, myisam

[15 Mar 2005 10:46] Shane Bester
Description:
After loading mysqldump'ed data into the table, and re-running the binlog against the table, a repeatable test cases shows that the table is marked as crashed each time and requires REPAIR TABLE to be run.

Can't open file: 'table.MYI' (errno: 145) appears in the logs, when using the table after the binlog has been imported.

How to repeat:
Please see internal info for steps.

Suggested fix:
Find out why the corruption is occurring.
[15 Mar 2005 10:53] MySQL Verification Team
Added steps how to reproduce.
[17 Mar 2005 10:26] MySQL Verification Team
Feedback on offending query.
[24 Mar 2005 16:31] MySQL Verification Team
More tesing
[8 Apr 2005 12:13] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/23802
[8 Apr 2005 12:28] Ingo Strüwing
This is somewhat similar to Bug #6151. In 6151 I fixed the delete part, in 9188 the insert part. Since 4.1, keys are padded with blanks for comparison. This means that a key like 'x  ' can be inserted among a couple of keys like 'x'. In cases where keys are packed, the key behind the new key needs to be recoded properly. The code was already in place, but seemingly never be tested.
[28 Apr 2005 1:27] Paul DuBois
Noted in 4.1.12 changelog.