From 479a5832f0dc4a146702f3adbca34ee051c39080 Mon Sep 17 00:00:00 2001 From: Julius Goryavsky Date: Wed, 28 Aug 2024 04:12:10 +0200 Subject: [PATCH] galera fix: MSAN reports use-of-uninitialized-value on binlog_encryption This commit fixes a bug in MSAN verification in debug builds related to the member of a lex->definer structure field that may be uninitialized for some SET statements. The bug is caused by debug output in a wsrep-specific insert and does not affect server functionality. --- sql/log_event_server.cc | 7 +++++-- sql/service_wsrep.cc | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc index 9f7fea18075..603bd2f6e78 100644 --- a/sql/log_event_server.cc +++ b/sql/log_event_server.cc @@ -1728,8 +1728,11 @@ int Query_log_event::do_apply_event(rpl_group_info *rgi, DBUG_PRINT("query",("%s", thd->query())); #ifdef WITH_WSREP - WSREP_DEBUG("Query_log_event thread=%llu for query=%s", - thd_get_thread_id(thd), wsrep_thd_query(thd)); + if (WSREP(thd)) + { + WSREP_DEBUG("Query_log_event thread=%llu for query=%s", + thd_get_thread_id(thd), wsrep_thd_query(thd)); + } #endif if (unlikely(!(expected_error= error_code)) || diff --git a/sql/service_wsrep.cc b/sql/service_wsrep.cc index d1e0260d53c..16bb2783cfb 100644 --- a/sql/service_wsrep.cc +++ b/sql/service_wsrep.cc @@ -82,8 +82,7 @@ extern "C" const char *wsrep_thd_query(const THD *thd) case SQLCOM_REVOKE: return "REVOKE"; case SQLCOM_SET_OPTION: - if (thd->lex->definer) - return "SET PASSWORD"; + return "SET OPTION"; /* fallthrough */ default: {