diff options
| author | Sergey Vojtovich <svoj@mariadb.org> | 2018-09-12 16:36:45 +0400 |
|---|---|---|
| committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-05-14 15:23:09 +0300 |
| commit | 95fb88d5469e9d601aa9c2f319d1b561925e9795 (patch) | |
| tree | 396d6a2a905c35027324fce33d595441a71e3d4c /sql/sql_truncate.cc | |
| parent | 43bbf88dcbab470947af0567f265d9659b07aab8 (diff) | |
| download | mariadb-git-95fb88d5469e9d601aa9c2f319d1b561925e9795.tar.gz | |
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.
Diffstat (limited to 'sql/sql_truncate.cc')
| -rw-r--r-- | sql/sql_truncate.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index a00659e362b..ea4d7399ea3 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -396,6 +396,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); /* |
