mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-31618: Server crashes in process_i_s_table_temporary_tables/get_all_tables after alter in rename query
Any TMP_TABLE_SHARE must always have at least one TABLE instance. So whenever a temporary TABLE that is marked for reopen is closed, reopen it at once if its TMP_TABLE_SHARE list of tables becomes empty.
This commit is contained in:
committed by
Sergei Golubchik
parent
de57da733f
commit
80439e6918
@@ -1086,8 +1086,13 @@ TABLE *THD::find_temporary_table(const char *key, uint key_length,
|
||||
{
|
||||
share->all_tmp_tables.remove(table);
|
||||
free_temporary_table(table);
|
||||
it.rewind();
|
||||
continue;
|
||||
if (share->all_tmp_tables.is_empty())
|
||||
table= open_temporary_table(share, share->table_name.str);
|
||||
else
|
||||
{
|
||||
it.rewind();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
result= table;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user