mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
WL#1895 - Print message to error log in case of detected MyISAM corruption
Changed my_error() to print error messages, which come from arbitrary registered ranges of error messages. Messages can be unregistered (and should be at end of the program). Added registration of handler error messages. Added a new mi_print_error() macro and a new mi_report_error() function, which supply error messages with a table name. Added calls to mi_print_error() or mi_report_error() at all places in MyISAM, where table corruption is detected.
This commit is contained in:
@ -76,6 +76,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
|
||||
my_string record;
|
||||
const char **int_array;
|
||||
bool use_hash, null_field_first;
|
||||
bool error_reported= FALSE;
|
||||
File file;
|
||||
Field **field_ptr,*reg_field;
|
||||
KEY *keyinfo;
|
||||
@ -788,6 +789,11 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
|
||||
error= 1;
|
||||
my_errno= ENOENT;
|
||||
}
|
||||
else
|
||||
{
|
||||
outparam->file->print_error(err, MYF(0));
|
||||
error_reported= TRUE;
|
||||
}
|
||||
goto err_not_open; /* purecov: inspected */
|
||||
}
|
||||
}
|
||||
@ -814,7 +820,8 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
|
||||
err_end: /* Here when no file */
|
||||
delete crypted;
|
||||
*root_ptr= old_root;
|
||||
frm_error(error,outparam,name,ME_ERROR+ME_WAITTANG);
|
||||
if (! error_reported)
|
||||
frm_error(error,outparam,name,ME_ERROR+ME_WAITTANG);
|
||||
delete outparam->file;
|
||||
outparam->file=0; // For easier errorchecking
|
||||
outparam->db_stat=0;
|
||||
|
Reference in New Issue
Block a user