1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-31523 Using two temporary tables in OPTIMIZE TABLE lead to crash

Fixed typo in mysql_admin_table which cused call of
close_unused_temporary_table_instances alwas for the first table
instead of the current table.

Added ASSERT that close_unused_temporary_table_instances should not
remove all instances of user created temporary table.
This commit is contained in:
Oleksandr Byelkin
2024-01-11 11:21:32 +01:00
parent 88c46aba75
commit f807a9f874
4 changed files with 38 additions and 1 deletions

View File

@ -776,7 +776,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
if (lock_type == TL_WRITE && table->mdl_request.type > MDL_SHARED_WRITE)
{
if (table->table->s->tmp_table)
thd->close_unused_temporary_table_instances(tables);
thd->close_unused_temporary_table_instances(table);
else
{
if (wait_while_table_is_used(thd, table->table, HA_EXTRA_NOT_USED))