diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-10-28 08:48:36 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-10-28 08:48:36 +0300 |
commit | a8ded395578ccab9c256b9beee7e62d4ada08522 (patch) | |
tree | 3560bcda4fc05f41dd8a96df37152802d928a423 /sql/sql_insert.cc | |
parent | f7bd369973ae56fe068302f0ff1c4e84d01bff75 (diff) | |
parent | 3a79e5fd317316c293baa459e8296fdb0744c280 (diff) | |
download | mariadb-git-a8ded395578ccab9c256b9beee7e62d4ada08522.tar.gz |
Merge 10.4 into 10.5
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r-- | sql/sql_insert.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index c4d0a871ba5..969d831bc4e 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -5105,12 +5105,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; @@ -5149,5 +5143,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; } |