summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-10-28 07:50:05 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-10-28 07:50:05 +0300
commit657bcf928eb1c6a80ee2c82f0dcdd59ab02927e4 (patch)
treec692f1600c06da934cf44240228516eed88c868f /sql/sql_insert.cc
parente97b785d764f85009412947600195001be01a706 (diff)
parent563daec123728f69dc56d898d1d8b198e9e2d411 (diff)
downloadmariadb-git-657bcf928eb1c6a80ee2c82f0dcdd59ab02927e4.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 201567c0853..a9f5c01ed41 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -4849,12 +4849,6 @@ void select_create::abort_result_set()
/* possible error of writing binary log is ignored deliberately */
(void) thd->binlog_flush_pending_rows_event(TRUE, TRUE);
- if (create_info->table_was_deleted)
- {
- /* Unlock locked table that was dropped by CREATE */
- thd->locked_tables_list.unlock_locked_table(thd,
- create_info->mdl_ticket);
- }
if (table)
{
bool tmp_table= table->s->tmp_table;
@@ -4893,5 +4887,13 @@ void select_create::abort_result_set()
tmp_table);
}
}
+
+ if (create_info->table_was_deleted)
+ {
+ /* Unlock locked table that was dropped by CREATE. */
+ (void) trans_rollback_stmt(thd);
+ thd->locked_tables_list.unlock_locked_table(thd, create_info->mdl_ticket);
+ }
+
DBUG_VOID_RETURN;
}