summaryrefslogtreecommitdiff
path: root/sql/sql_truncate.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-10-05 08:09:49 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-10-05 08:09:49 +0300
commit444c380ceb26895748ce50c50be3f839393ebfd7 (patch)
tree65b1fbf3b7caec3de48c1f76de4614a2d9793a8d /sql/sql_truncate.cc
parent55dd0776566000c5ea12e177df0c784b500ab7c1 (diff)
parent941ca92a2ca3990020b23bcc92e7ca98dcc8f814 (diff)
downloadmariadb-git-444c380ceb26895748ce50c50be3f839393ebfd7.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'sql/sql_truncate.cc')
-rw-r--r--sql/sql_truncate.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc
index 34177242704..798e929170c 100644
--- a/sql/sql_truncate.cc
+++ b/sql/sql_truncate.cc
@@ -299,7 +299,7 @@ bool Sql_cmd_truncate_table::lock_table(THD *thd, TABLE_LIST *table_ref,
if (thd->locked_tables_mode)
{
if (!(table= find_table_for_mdl_upgrade(thd, table_ref->db.str,
- table_ref->table_name.str, FALSE)))
+ table_ref->table_name.str, NULL)))
DBUG_RETURN(TRUE);
*hton_can_recreate= ha_check_storage_engine_flag(table->file->ht,
@@ -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);
/*