mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge 10.5 into 10.6
This commit is contained in:
@ -477,6 +477,15 @@ bool Sql_cmd_truncate_table::truncate_table(THD *thd, TABLE_LIST *table_ref)
|
||||
*/
|
||||
error= handler_truncate(thd, table_ref, FALSE);
|
||||
|
||||
if (error == TRUNCATE_OK && thd->locked_tables_mode &&
|
||||
(table_ref->table->file->ht->flags &
|
||||
HTON_REQUIRES_CLOSE_AFTER_TRUNCATE))
|
||||
{
|
||||
thd->locked_tables_list.mark_table_for_reopen(thd, table_ref->table);
|
||||
if (unlikely(thd->locked_tables_list.reopen_tables(thd, true)))
|
||||
thd->locked_tables_list.unlink_all_closed_tables(thd, NULL, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
All effects of a TRUNCATE TABLE operation are committed even if
|
||||
truncation fails in the case of non transactional tables. Thus, the
|
||||
|
Reference in New Issue
Block a user