Bug #36577 MyISAM: --myisam-recover= is not like --myisam-recover, contradicts doc
Submitted: 7 May 2008 19:44 Modified: 12 May 2008 21:13
Reporter: Guilhem Bichot Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:5.1-bk, 5.0 OS:Any
Assigned to: CPU Architecture:Any

[7 May 2008 19:44] Guilhem Bichot
Description:
Have not checked 5.0, please do.
http://dev.mysql.com/doc/refman/5.1/en/server-options.html says
about --myisam-recover:
'specifying with an explicit value of "" disables recovery (same as not giving the option)'
but this is not true: if you use --myisam-recover= , it does change ha_open_options (see mysqld.cc), whereas if you don't use any --myisam-recover, it does not, and this has implications:
if there is a crash while a table t was open, and table is in fact not corrupted (just has a positive open count due to the crash), and mysqld is restarted,
* with --myisam-recover= , "SELECT * FROM t" will report corruption and not repair it, leaving table un-accessible.
* with no --myisam-recover , "SELECT * FROM t" will not report corruption (will display proper content).

How to repeat:
For these tests, always run your mysql command-line client with -A (so that it does not open your tables behind the scenes).

start with --myisam-recover= .
create table t(a int) engine=myisam;
insert into t values(1); # leaves table open
system killall -9 mysqld;

restart mysqld
select * from t; # error
drop table t;

Redo everything without --myisam-recover: SELECT will succeed.

Suggested fix:
To make --myisam-recover= identical to no --myisam-recover, add a 'break' here in mysqld.cc:
  case OPT_MYISAM_RECOVER:
  {
    if (!argument)
    {
      myisam_recover_options=    HA_RECOVER_DEFAULT;
      myisam_recover_options_str= myisam_recover_typelib.type_names[0];
    }
    else if (!argument[0])
    {
      myisam_recover_options= HA_RECOVER_NONE;
      myisam_recover_options_str= "OFF";
// add 'break;' here
    }
[12 May 2008 21:13] Sveta Smirnova
Thank you for the report.

Verified as described. Used even --myisam-recover="" to be sure.