summaryrefslogtreecommitdiff
path: root/sql/sql_truncate.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_truncate.cc')
-rw-r--r--sql/sql_truncate.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc
index 5a6417880b3..bab9bb5e9ac 100644
--- a/sql/sql_truncate.cc
+++ b/sql/sql_truncate.cc
@@ -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);
/*