maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #06814
Re: Rev 4029: MDEV-4856 SQL_ERROR_LOG shows 1146 errors which didnt appear in mysql client
Hi, Alexey!
On Feb 14, Alexey Botchkov wrote:
> > But I don't understand that. Do you mean, old code did *not* suppress
> > errors here? How could selects from I_S tables work without it?
>
> Here's how it works today:
>
> get_all_tables()
> Trigger_error_handler err_handler;
> thd->push_internal_handler(&err_handler);
> fill_schema_table_from_frm
> get_table_share
> .... /* here we get the error of file not found */
> my_message_sql
> THD::raise_condition
> /* here we test the err_handler */
> /* but it doesn't react on that kind of errors */
> mysql_audit_notify()
> stmt_da->set_error_status
> warning_info->push_warning
> /
> /
> .... /*error is returned back along the call stack */
> /
> thd->clear_error(); /*which erases all the fileopen errors*/
> /
>
> So basically the error is launched and then erased. Which doesn't help
> with the plugin notifications.
> To fix that i added one more error handler.
It's worse than that :)
After thd->clear_error() the error flag is cleared, indeed. But all
issued errors are still present in the warning list. I've looked into
this about found this little gem: do_fill_table() function.
It actually copies Warning_info list and removes warnings from there!
Could you, please remove that piece of fine creativity and
thd->clear_error() too and use the error handler instead?
Looking at the logic of do_fill_table(), all you need to do is to
filter out all errors, but keep all warnings. Like
class Warnings_only_error_handler : public Internal_error_handler
{
public:
bool handle_condition(THD *thd, uint sql_errno, const char* sqlstate,
MYSQL_ERROR::enum_warning_level level,
const char* msg, MYSQL_ERROR ** cond_hdl)
{
return level == MYSQL_ERROR::WARN_LEVEL_ERROR;
}
};
Regards,
Sergei
Follow ups
References