diff options
author | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2021-07-26 16:31:22 +0530 |
---|---|---|
committer | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2021-09-06 18:12:45 +0530 |
commit | edde990e35f4760e419bad1f0cb5b57ea9e2f863 (patch) | |
tree | ae5dbd9bb98e2cf28431740b436f5ef7f6a61c5a /sql/sql_truncate.cc | |
parent | f17537579ad0270b5d79f00ff30192506dce0e59 (diff) | |
download | mariadb-git-bb-10.2-MDEV-23365.tar.gz |
MDEV-23365: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())'bb-10.2-MDEV-23365
failed upon killed TRUNCATE
Note: This is a backport of 1cb4caa66d5fd2a9bc095d68988324b7b358d70f from
10.3
Analysis: Assertion failure happens because less session memory is set and so
table can't be reopened. So the statement can't be used. This error goes
unreported.
Fix: Return the error state.
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; } |