1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-26456: SIGSEGV in flush_tables_with_read_lock on FLUSH TABLE

It is legal that open table can leave unopened tables in SP and other
parts of the code shoud expect it.
This commit is contained in:
Oleksandr Byelkin
2022-07-20 14:13:07 +02:00
parent 0ea221e12b
commit 654236c06d
3 changed files with 35 additions and 0 deletions

View File

@ -601,6 +601,7 @@ bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables)
if (table_list->is_view_or_derived())
continue;
if (thd->lex->type & REFRESH_FOR_EXPORT &&
table_list->table &&
!(table_list->table->file->ha_table_flags() & HA_CAN_EXPORT))
{
my_error(ER_ILLEGAL_HA, MYF(0),table_list->table->file->table_type(),
@ -608,6 +609,7 @@ bool flush_tables_with_read_lock(THD *thd, TABLE_LIST *all_tables)
goto error_reset_bits;
}
if (thd->lex->type & REFRESH_READ_LOCK &&
table_list->table &&
table_list->table->file->extra(HA_EXTRA_FLUSH))
goto error_reset_bits;
}