mirror of
https://github.com/MariaDB/server.git
synced 2025-07-16 00:42:55 +03:00
MDEV-17167 - InnoDB: Failing assertion: table->get_ref_count() == 0 upon
truncating a temporary table TRUNCATE expects only one TABLE instance (which is used by TRUNCATE itself) to be open. However this requirement wasn't enforced after "MDEV-5535: Cannot reopen temporary table". Fixed by closing unused table instances before performing TRUNCATE.
This commit is contained in:
@ -401,6 +401,8 @@ bool Sql_cmd_truncate_table::truncate_table(THD *thd, TABLE_LIST *table_ref)
|
||||
/* In RBR, the statement is not binlogged if the table is temporary. */
|
||||
binlog_stmt= !thd->is_current_stmt_binlog_format_row();
|
||||
|
||||
thd->close_unused_temporary_table_instances(table_ref);
|
||||
|
||||
error= handler_truncate(thd, table_ref, TRUE);
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user