Bug #32897 Myisamchk inconsistant
Submitted: 1 Dec 2007 20:32 Modified: 3 Dec 2007 15:12
Reporter: Guy Gordon Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:5.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: MyISAMchk, Repair

[1 Dec 2007 20:32] Guy Gordon
Myisamchk table checks both table.myi and table.myd.  Myisamchk table.myi also checks both files.  But myisamchk table.myd gives an error message implying that no valid index exists.  

Several user comments in the documentation show that this is a real problem for users.

How to repeat:
myisamchk table.myd
myisamchk: error: '<table>' doesn't have a correct index definition. You need to recreate it before you can do a repair.

Suggested fix:
Make it consistent, or change the error message.  

Since parameters "table" and "table.myi" check both myi and myd files, the code should be changed to do the same thing when "table.myd" is specified.

At the very least the code should check if table.myi exists before complaining that it isn't correct.  But it's clear and unambiguous what the user wants, so the code should do it.
[2 Dec 2007 9:26] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

This behaviour is correctly described at http://dev.mysql.com/doc/refman/5.0/en/myisamchk.html
[2 Dec 2007 17:02] Guy Gordon
Yes, it's a bug.  If my software says 1+1=2, and I document the fact, that doesn't make it "not a bug".

Second, the link you supply (http://dev.mysql.com/doc/refman/5.0/en/myisamchk.html) does *not* describe this behavior.  It states you can invoke myisamchk table or myisamchk *.myi.  It says nothing about myisamchk table.myd.  (It is also incorrect about *.myi which doesn't work under Microsoft Windows)

Most importantly, your dismissal of this report does not address the fact that this inconsistency confuses users.  Please read the first two comments on 
http://dev.mysql.com/doc/refman/5.0/en/myisamchk-repair-options.html and the
first comment on http://dev.mysql.com/doc/refman/5.0/en/repair.html.  Both people concluded that myisamchk was telling them the index file was corrupted, when in fact they had simply invoked it wrong.

You do not address my point that the user's intent for "myisamchk table.myd" is clear and unambiguous, whereas the error message "error: '<table>' doesn't have a correct index definition. You need to recreate it before you can do a repair." is misleading because myisamchk has not bothered to check to see if there *is* an index file.

Finally, if you have a problem with how I reported this bug, please do not refer me to the ENTIRE MYSQL 5.0 DOCUMENTATION.  Be a little more specific please.
[3 Dec 2007 15:12] Sveta Smirnova
Thank you for the feedback.

Reclassified as feature request.