summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2020-11-30 15:29:32 +0200
committerMonty <monty@mariadb.org>2020-11-30 22:21:43 +0200
commit828471cbf83774f4537a78551290b7a4a7f5d374 (patch)
treeef6dee7179466f556d64cd1e9d76038cc6bf3ddc /sql/log_event.cc
parent37352c4b554a46895cd725ab17c9397724a43757 (diff)
downloadmariadb-git-828471cbf83774f4537a78551290b7a4a7f5d374.tar.gz
MDEV 15532 Assertion `!log->same_pk' failed in row_log_table_apply_delete
The reason for the failure is that thd->mdl_context.release_transactional_locks() was called after commit & rollback even in cases where the current transaction is still active. For 10.2, 10.3 and 10.4 the fix is simple: - Replace all calls to thd->mdl_context.release_transactional_locks() with thd->release_transactional_locks(). The thd function will only call the mdl_context function if there are no active transactional locks. In 10.6 we will better fix where we will change the return value for some trans_xxx() functions to indicate if transaction did close the transaction or not. This will avoid the need of the indirect call. Other things: - trans_xa_commit() and trans_xa_rollback() will automatically call release_transactional_locks() if the transaction is closed. - We can't do that for the other functions as the caller of many of these are doing additional work (like close_thread_tables) before calling release_transactional_locks(). - Added missing abort_result_set() and missing DBUG_RETURN in select_create::send_eof() - Fixed wrong indentation in injector::transaction::commit()
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 097cbe8da9d..c649e1f64fa 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -7150,10 +7150,10 @@ error:
if (thd->transaction_rollback_request)
{
trans_rollback_implicit(thd);
- thd->mdl_context.release_transactional_locks();
+ thd->release_transactional_locks();
}
else if (! thd->in_multi_stmt_transaction_mode())
- thd->mdl_context.release_transactional_locks();
+ thd->release_transactional_locks();
else
thd->mdl_context.release_statement_locks();
@@ -8554,7 +8554,7 @@ int Xid_log_event::do_apply_event(rpl_group_info *rgi)
"COMMIT /* implicit, from Xid_log_event */");
thd->variables.option_bits&= ~OPTION_GTID_BEGIN;
res= trans_commit(thd); /* Automatically rolls back on error. */
- thd->mdl_context.release_transactional_locks();
+ thd->release_transactional_locks();
#ifdef WITH_WSREP
if (WSREP(thd)) mysql_mutex_lock(&thd->LOCK_thd_data);