diff options
Diffstat (limited to 'sql/sql_truncate.cc')
-rw-r--r-- | sql/sql_truncate.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index 7d1f630b88c..e5165c5a855 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -426,8 +426,10 @@ bool Sql_cmd_truncate_table::truncate_table(THD *thd, TABLE_LIST *table_ref) error= dd_recreate_table(thd, table_ref->db, table_ref->table_name); if (thd->locked_tables_mode && thd->locked_tables_list.reopen_tables(thd, false)) + { thd->locked_tables_list.unlink_all_closed_tables(thd, NULL, 0); - + error= 1; + } /* No need to binlog a failed truncate-by-recreate. */ binlog_stmt= !error; } |