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

MDEV-20471 Assertion during cleanup of failed CREATE TABLE LIKE <sequence>

While cleaning up a failed CREATE TABLE LIKE <sequence>, `mysql_rm_table_no_locks`
erroneously attempted to remove all tables involved in the query, including
the source table (sequence).

Fix to temporarily modify `table_list` to ensure that only the intended
table is removed during the cleanup.
This commit is contained in:
Vladislav Vaintroub
2023-10-18 12:34:04 +02:00
parent 699cfee595
commit f53321cbdb
4 changed files with 39 additions and 2 deletions

View File

@ -300,7 +300,8 @@ bool sequence_insert(THD *thd, LEX *lex, TABLE_LIST *org_table_list)
Query_tables_list query_tables_list_backup;
TABLE_LIST table_list; // For sequence table
DBUG_ENTER("sequence_insert");
DBUG_EXECUTE_IF("kill_query_on_sequence_insert",
thd->set_killed(KILL_QUERY););
/*
seq is 0 if sequence was created with CREATE TABLE instead of
CREATE SEQUENCE