@ -61,7 +61,7 @@ ulonglong pagecache_buffer_size;
good . It would happen only after Recovery , if the table is still
good . It would happen only after Recovery , if the table is still
corrupted .
corrupted .
*/
*/
ulong maria_recover_options = HA_RECOVER_NONE ;
ulonglong maria_recover_options = HA_RECOVER_NONE ;
handlerton * maria_hton ;
handlerton * maria_hton ;
/* bits in maria_recover_options */
/* bits in maria_recover_options */
@ -71,10 +71,9 @@ const char *maria_recover_names[]=
Compared to MyISAM , " default " was renamed to " normal " as it collided with
Compared to MyISAM , " default " was renamed to " normal " as it collided with
SET var = default which sets to the var ' s default i . e . what happens when the
SET var = default which sets to the var ' s default i . e . what happens when the
var is not set i . e . HA_RECOVER_NONE .
var is not set i . e . HA_RECOVER_NONE .
Another change is that OFF is used to disable , not " " ; this is to have OFF
display in SHOW VARIABLES which is better than " " .
OFF flag is ignored .
*/
*/
" OFF " , " NORMAL " , " BACKUP " , " FORCE " , " QUICK " , NullS
" NORMAL " , " BACKUP " , " FORCE " , " QUICK " , " OFF " , NullS
} ;
} ;
TYPELIB maria_recover_typelib =
TYPELIB maria_recover_typelib =
{
{
@ -241,10 +240,10 @@ static MYSQL_SYSVAR_ULONG(pagecache_division_limit, pagecache_division_limit,
" The minimum percentage of warm blocks in key cache " , 0 , 0 ,
" The minimum percentage of warm blocks in key cache " , 0 , 0 ,
100 , 1 , 100 , 1 ) ;
100 , 1 , 100 , 1 ) ;
static MYSQL_SYSVAR_ENUM ( recover , maria_recover_options , PLUGIN_VAR_OPCMDARG ,
static MYSQL_SYSVAR_SET ( recover , maria_recover_options , PLUGIN_VAR_OPCMDARG ,
" Specifies how corrupted tables should be automatically repaired. "
" Specifies how corrupted tables should be automatically repaired. "
" Possible values are \" NORMAL \" (the default), \" BACKUP \" , \" FORCE \" , "
" \" QUICK \" , or \" OFF \" which is like not using the option ." ,
" Possible values are one or more of \" NORMAL \" (the default), "
" \" BACKUP \" , \" FORCE \" , or \" QUICK \" . " ,
NULL , NULL , HA_RECOVER_DEFAULT , & maria_recover_typelib ) ;
NULL , NULL , HA_RECOVER_DEFAULT , & maria_recover_typelib ) ;
static MYSQL_THDVAR_ULONG ( repair_threads , PLUGIN_VAR_RQCMDARG ,
static MYSQL_THDVAR_ULONG ( repair_threads , PLUGIN_VAR_RQCMDARG ,
@ -1015,7 +1014,7 @@ int ha_maria::open(const char *name, int mode, uint test_if_locked)
test_if_locked | = HA_OPEN_MMAP ;
test_if_locked | = HA_OPEN_MMAP ;
# endif
# endif
if ( unlikely ( maria_recover_options ! = HA_RECOVER_NONE ) )
if ( maria_recover_options & HA_RECOVER_ANY )
{
{
/* user asked to trigger a repair if table was not properly closed */
/* user asked to trigger a repair if table was not properly closed */
test_if_locked | = HA_OPEN_ABORT_IF_CRASHED ;
test_if_locked | = HA_OPEN_ABORT_IF_CRASHED ;
@ -1615,9 +1614,6 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize)
_ma_check_print_warning ( param , " Number of rows changed from %s to %s " ,
_ma_check_print_warning ( param , " Number of rows changed from %s to %s " ,
llstr ( rows , llbuff ) ,
llstr ( rows , llbuff ) ,
llstr ( file - > state - > records , llbuff2 ) ) ;
llstr ( file - > state - > records , llbuff2 ) ) ;
/* Abort if warning was converted to error */
if ( table - > in_use - > is_error ( ) )
error = 1 ;
}
}
}
}
else
else
@ -3240,7 +3236,7 @@ static int mark_recovery_start(const char* log_dir)
{
{
int res ;
int res ;
DBUG_ENTER ( " mark_recovery_start " ) ;
DBUG_ENTER ( " mark_recovery_start " ) ;
if ( unlikely ( maria_recover_options = = HA_RECOVER_NONE ) )
if ( ! ( maria_recover_options & HA_RECOVER_ANY ) )
ma_message_no_user ( ME_JUST_WARNING , " Please consider using option "
ma_message_no_user ( ME_JUST_WARNING , " Please consider using option "
" --aria-recover[=...] to automatically check and "
" --aria-recover[=...] to automatically check and "
" repair tables when logs are removed by option "
" repair tables when logs are removed by option "