mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Remember first error in Dummy_error_handler
Use Dummy_error_handler in open_stat_tables() to ignore all errors when opening statistics tables.
This commit is contained in:
@@ -293,17 +293,17 @@ static inline int open_stat_table_for_ddl(THD *thd, TABLE_LIST *table,
|
||||
const LEX_CSTRING *stat_tab_name)
|
||||
{
|
||||
table->init_one_table(&MYSQL_SCHEMA_NAME, stat_tab_name, NULL, TL_WRITE);
|
||||
No_such_table_error_handler nst_handler;
|
||||
thd->push_internal_handler(&nst_handler);
|
||||
Dummy_error_handler error_handler;
|
||||
thd->push_internal_handler(&error_handler);
|
||||
int res= open_system_tables_for_read(thd, table);
|
||||
thd->pop_internal_handler();
|
||||
if (res && nst_handler.any_error())
|
||||
if (res && error_handler.any_error())
|
||||
{
|
||||
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
ER_CHECK_NO_SUCH_TABLE,
|
||||
"Got error %d when trying to open statistics "
|
||||
"table %`s for updating statistics",
|
||||
nst_handler.got_error(), stat_table_name->str);
|
||||
error_handler.got_error(), stat_table_name->str);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
Reference in New Issue
Block a user