1
0
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:
Monty
2023-10-05 09:59:13 +03:00
parent 8941bdc474
commit fdcb443e62
3 changed files with 16 additions and 9 deletions

View File

@@ -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;
}