Bug #3445 mysqlcheck doesn't handle correctly Memory table with --auto-repair option
Submitted: 12 Apr 2004 6:04 Modified: 4 May 2004 12:32
Reporter: jocelyn fournier (Silver Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.2 latest bk tree OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[12 Apr 2004 6:04] jocelyn fournier
Description:
Hi,

mysqlcheck with option --auto-repair doesn't handle correctly Memory type tables.
(fails with a "Incorrect table name" error instead of gracefully skipping the table).

Regards,
  Jocelyn

How to repeat:
create database mysqlcheck_test;
use mysqlcheck_test;
CREATE TABLE a (a int);
CREATE TABLE b (a int) ENGINE=Memory;
exit;

mysqlcheck -B mysqlcheck_test -uroot -p --auto-repair                                                 
Enter password: 
mysqlcheck_test.a                                  OK
mysqlcheck_test.b
error    : The storage engine for the table doesn't support check

Repairing tables
mysqlcheck: Got error: 1103: Incorrect table name 'mysqlcheck_test.b' when executing 'REPAIR TABLE ... '

However if you use -r option instead of --auto-repair, all works properly :

mysqlcheck -B mysqlcheck_test -uroot -p -r                                                           
Enter password: 
mysqlcheck_test.a                                  OK
mysqlcheck_test.b
error    : The storage engine for the table doesn't support repair
[4 May 2004 12:32] Michael Widenius
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

I tested this with my 4.1.2 tree, but I could not get the error message 'Incorrect table name'

I did however change the "Msg_type" for not supporting check from "error" to "note" and changed mysqlcheck to not try to auto-repair tables that doesn't support 'check'.