summaryrefslogtreecommitdiffstats
path: root/sql/wsrep_client_service.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
commit86fbb58c3ac0865482819c10a3e81f2eea001c36 (patch)
tree28c9e526ea739c6f9b89e36115e1e2698bddf981 /sql/wsrep_client_service.cc
parentReleasing progress-linux version 1:10.11.6-2~progress7.99u1. (diff)
downloadmariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.tar.xz
mariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.zip
Merging upstream version 1:10.11.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sql/wsrep_client_service.cc')
-rw-r--r--sql/wsrep_client_service.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/wsrep_client_service.cc b/sql/wsrep_client_service.cc
index d3b4a181..e26cac50 100644
--- a/sql/wsrep_client_service.cc
+++ b/sql/wsrep_client_service.cc
@@ -281,11 +281,18 @@ enum wsrep::provider::status Wsrep_client_service::replay()
original THD state during replication event applying.
*/
THD *replayer_thd= new THD(true, true);
+ // Replace the security context of the replayer with the security context
+ // of the original THD. Since security context class doesn't have proper
+ // copy constructors, we need to store the original one and set it back
+ // before destruction so that THD desctruction doesn't cause double-free
+ // on the replaced security context.
+ Security_context old_ctx = replayer_thd->main_security_ctx;
+ replayer_thd->main_security_ctx = m_thd->main_security_ctx;
replayer_thd->thread_stack= m_thd->thread_stack;
replayer_thd->real_id= pthread_self();
replayer_thd->prior_thr_create_utime=
replayer_thd->start_utime= microsecond_interval_timer();
- replayer_thd->set_command(COM_SLEEP);
+ replayer_thd->mark_connection_idle();
replayer_thd->reset_for_next_command(true);
enum wsrep::provider::status ret;
@@ -297,6 +304,7 @@ enum wsrep::provider::status Wsrep_client_service::replay()
replayer_service.replay_status(ret);
}
+ replayer_thd->main_security_ctx = old_ctx;
delete replayer_thd;
DBUG_RETURN(ret);
}