From 1ffbfb9ddc76cc1b133e656c187dc59f1580e2f4 Mon Sep 17 00:00:00 2001 From: ChandanaRamakrishna Date: Wed, 18 Feb 2026 21:01:00 +0530 Subject: [PATCH] MDEV-29466: Rename description_event_for_exec to description_event_for_sql_thread --- sql/log.cc | 4 ++-- sql/log.h | 4 +++- sql/log_event_server.cc | 12 ++++++------ sql/rpl_rli.cc | 10 +++++----- sql/slave.cc | 14 +++++++------- sql/sql_binlog.cc | 10 +++++----- sql/sql_table.cc | 6 +++--- sql/wsrep_applier.cc | 2 +- sql/wsrep_high_priority_service.cc | 4 ++-- 9 files changed, 34 insertions(+), 32 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index 8e2e37a83fcd0..45160bc8cdd14 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -4369,7 +4369,7 @@ MYSQL_BIN_LOG::MYSQL_BIN_LOG(uint *sync_period) is_relay_log(0), relay_signal_cnt(0), checksum_alg_reset(BINLOG_CHECKSUM_ALG_UNDEF), relay_log_checksum_alg(BINLOG_CHECKSUM_ALG_UNDEF), - description_event_for_exec(0), description_event_for_queue(0), + description_event_for_sql_thread(0), description_event_for_queue(0), current_binlog_id(0), reset_master_count(0) { /* @@ -4423,7 +4423,7 @@ void MYSQL_BIN_LOG::cleanup() close(LOG_CLOSE_INDEX|LOG_CLOSE_STOP_EVENT); mysql_mutex_unlock(&LOCK_log); delete description_event_for_queue; - delete description_event_for_exec; + delete description_event_for_sql_thread; while ((b= binlog_xid_count_list.get())) { diff --git a/sql/log.h b/sql/log.h index 116aa14e5b9df..ad448c4a647dd 100644 --- a/sql/log.h +++ b/sql/log.h @@ -903,7 +903,9 @@ class MYSQL_BIN_LOG: public TC_LOG, public Event_log the case of a master which has been upgraded from 5.0 to 5.1 without doing RESET MASTER, or from 4.x to 5.0). */ - Format_description_log_event *description_event_for_exec, + + Format_description_log_event *description_event_for_sql_thread, + *description_event_for_queue; /* Binlog position of last commit (or non-transactional write) to the binlog. diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc index ae97285b1797b..a3426f93a2e9b 100644 --- a/sql/log_event_server.cc +++ b/sql/log_event_server.cc @@ -2650,9 +2650,9 @@ int Format_description_log_event::do_apply_event(rpl_group_info *rgi) if (!ret) { /* Save the information describing this binlog */ - copy_crypto_data(rli->relay_log.description_event_for_exec); - delete rli->relay_log.description_event_for_exec; - rli->relay_log.description_event_for_exec= this; + copy_crypto_data(rli->relay_log.description_event_for_sql_thread); + delete rli->relay_log.description_event_for_sql_thread; + rli->relay_log.description_event_for_sql_thread= this; } DBUG_RETURN(ret); @@ -2696,7 +2696,7 @@ Format_description_log_event::do_shall_skip(rpl_group_info *rgi) #if defined(HAVE_REPLICATION) int Start_encryption_log_event::do_apply_event(rpl_group_info* rgi) { - return rgi->rli->relay_log.description_event_for_exec->start_decryption(this); + return rgi->rli->relay_log.description_event_for_sql_thread->start_decryption(this); } int Start_encryption_log_event::do_update_pos(rpl_group_info *rgi) @@ -2834,7 +2834,7 @@ int Rotate_log_event::do_update_pos(rpl_group_info *rgi) /* Reset thd->variables.option_bits and sql_mode etc, because this could be the signal of a master's downgrade from 5.0 to 4.0. - However, no need to reset description_event_for_exec: indeed, if the next + However, no need to reset description_event_for_sql_thread: indeed, if the next master is 5.0 (even 5.0.1) we will soon get a Format_desc; if the next master is 4.0 then the events are in the slave's format (conversion). */ @@ -5899,7 +5899,7 @@ int Partial_rows_log_event::do_apply_event(rpl_group_info *rgi) { THD_STAGE_INFO(rgi->thd, stage_constructing_rows_ev); Log_event *ev= assembler->create_rows_event( - rgi->rli->relay_log.description_event_for_exec); + rgi->rli->relay_log.description_event_for_sql_thread); rgi->assembler->~Rows_log_event_assembler(); my_free(rgi->assembler); rgi->assembler= NULL; diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index d151ee3ab3a26..e03357acbb12f 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -595,8 +595,8 @@ int init_relay_log_pos(Relay_log_info* rli,const char* log, the description_event here, in case, so that there is no memory leak in running, say, CHANGE MASTER. */ - delete rli->relay_log.description_event_for_exec; - rli->relay_log.description_event_for_exec= new Format_description_log_event(4); + delete rli->relay_log.description_event_for_sql_thread; + rli->relay_log.description_event_for_sql_thread= new Format_description_log_event(4); mysql_mutex_lock(log_lock); @@ -662,8 +662,8 @@ int init_relay_log_pos(Relay_log_info* rli,const char* log, Format_description_log_event *fdev; if (!(fdev= read_relay_log_description_event(rli->cur_log, pos, errmsg))) goto err; - delete rli->relay_log.description_event_for_exec; - rli->relay_log.description_event_for_exec= fdev; + delete rli->relay_log.description_event_for_sql_thread; + rli->relay_log.description_event_for_sql_thread= fdev; } my_b_seek(rli->cur_log,(off_t)pos); DBUG_PRINT("info", ("my_b_tell(rli->cur_log)=%llu rli->event_relay_log_pos=%llu", @@ -684,7 +684,7 @@ int init_relay_log_pos(Relay_log_info* rli,const char* log, if (need_data_lock) mysql_mutex_unlock(&rli->data_lock); - if (!rli->relay_log.description_event_for_exec->is_valid() && !*errmsg) + if (!rli->relay_log.description_event_for_sql_thread->is_valid() && !*errmsg) *errmsg= "Invalid Format_description log event; could be out of memory"; DBUG_PRINT("info", ("Returning %d from init_relay_log_pos", (*errmsg)?1:0)); diff --git a/sql/slave.cc b/sql/slave.cc index c6555369ec8b2..c96c93a598ac9 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -5520,8 +5520,8 @@ pthread_handler_t handle_slave_sql(void *arg) /* When master_pos_wait() wakes up it will check this and terminate */ rli->slave_running= MYSQL_SLAVE_NOT_RUN; /* Forget the relay log's format */ - delete rli->relay_log.description_event_for_exec; - rli->relay_log.description_event_for_exec= 0; + delete rli->relay_log.description_event_for_sql_thread; + rli->relay_log.description_event_for_sql_thread= 0; rli->reset_inuse_relaylog(); /* Wake up master_pos_wait() */ DBUG_PRINT("info",("Signaling possibly waiting master_pos_wait() functions")); @@ -6649,7 +6649,7 @@ static int queue_event(Master_info* mi, const uchar *buf, ulong event_len) else { /* - replay_log.description_event_for_exec can be null if the slave thread + replay_log.description_event_for_sql_thread can be null if the slave thread is getting killed */ if (LOG_EVENT_IS_QUERY((Log_event_type) buf[EVENT_TYPE_OFFSET]) || @@ -7093,7 +7093,7 @@ static Log_event* next_event(rpl_group_info *rgi, ulonglong *event_size) old_pos= rli->event_relay_log_pos; int error; if ((ev= Log_event::read_log_event(cur_log, &error, - rli->relay_log.description_event_for_exec, + rli->relay_log.description_event_for_sql_thread, opt_slave_sql_verify_checksum))) { @@ -7281,7 +7281,7 @@ static Log_event* next_event(rpl_group_info *rgi, ulonglong *event_size) mysql_file_close(rli->cur_log_fd, MYF(MY_WME)); rli->cur_log_fd = -1; rli->last_inuse_relaylog->completed= true; - rli->relay_log.description_event_for_exec->reset_crypto(); + rli->relay_log.description_event_for_sql_thread->reset_crypto(); if (relay_log_purge) { @@ -7609,7 +7609,7 @@ bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report, {29621, { 10, 11,1 }, { 10, 11,3 } }, }; const Version &master_ver= - rli->relay_log.description_event_for_exec->server_version_split; + rli->relay_log.description_event_for_sql_thread->server_version_split; struct st_version_range_for_one_bug* versions_for_all_bugs= maria_master ? versions_for_our_bugs : versions_for_their_bugs; uint all_size= maria_master ? @@ -7652,7 +7652,7 @@ bool rpl_master_has_bug(const Relay_log_info *rli, uint bug_id, bool report, " that master be upgraded to a version at least" " equal to '%d.%d.%d'. Then replication can be" " restarted.", - rli->relay_log.description_event_for_exec->server_version, + rli->relay_log.description_event_for_sql_thread->server_version, bug_source, bug_id, fixed_in[0], fixed_in[1], fixed_in[2]); diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc index 5456b03f2a72e..36ad1a4ceba1b 100644 --- a/sql/sql_binlog.cc +++ b/sql/sql_binlog.cc @@ -35,7 +35,7 @@ static int check_event_type(int type, Relay_log_info *rli) { Format_description_log_event *fd_event= - rli->relay_log.description_event_for_exec; + rli->relay_log.description_event_for_sql_thread; /* Convert event type id of certain old versions (see comment in @@ -204,7 +204,7 @@ int save_restore_context_apply_event(Log_event *ev, rpl_group_info *rgi) BINLOG statement seen must be a base64 encoding of the Format_description_log_event, as outputted by mysqlbinlog. This Format_description_log_event is cached in - rli->description_event_for_exec. + rli->description_event_for_sql_thread. @param thd Pointer to THD object for the client thread executing the statement. @@ -308,8 +308,8 @@ void mysql_client_binlog_statement(THD* thd) This is used to read the real Format_description_log_event, or to read all events if there is none (as happens with --binlog-storage-engine). */ - if (!rli->relay_log.description_event_for_exec && - !(rli->relay_log.description_event_for_exec= + if (!rli->relay_log.description_event_for_sql_thread && + !(rli->relay_log.description_event_for_sql_thread= new Format_description_log_event(4))) { my_error(ER_OUT_OF_RESOURCES, MYF(0)); @@ -359,7 +359,7 @@ void mysql_client_binlog_statement(THD* thd) goto end; ev= Log_event::read_log_event(bufptr, event_len, &error, - rli->relay_log.description_event_for_exec, + rli->relay_log.description_event_for_sql_thread, 0); DBUG_PRINT("info",("binlog base64 err=%s", error)); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 8b19e6947ee42..9f47277d1ef60 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -12509,7 +12509,7 @@ static int online_alter_read_from_binlog(THD *thd, rpl_group_info *rgi, thd->push_internal_handler(&hdeh); do { - const auto *descr_event= rgi->rli->relay_log.description_event_for_exec; + const auto *descr_event= rgi->rli->relay_log.description_event_for_sql_thread; auto *ev= Log_event::read_log_event(log_file, &error, descr_event, 0, 1, ~0UL); error= log_file->error; if (unlikely(!ev)) @@ -12527,7 +12527,7 @@ static int online_alter_read_from_binlog(THD *thd, rpl_group_info *rgi, if(likely(!error)) ev->online_alter_update_row_count(found_rows); - if (ev != rgi->rli->relay_log.description_event_for_exec) + if (ev != rgi->rli->relay_log.description_event_for_sql_thread) delete ev; thd_progress_report(thd, my_b_tell(log_file), thd->progress.max_counter); DEBUG_SYNC(thd, "alter_table_online_progress"); @@ -13086,7 +13086,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, Cache_flip_event_log *binlog= from->s->online_alter_binlog; DBUG_ASSERT(binlog->is_open()); - rli->relay_log.description_event_for_exec= + rli->relay_log.description_event_for_sql_thread= new Format_description_log_event(4); // We'll be filling from->record[0] from row events diff --git a/sql/wsrep_applier.cc b/sql/wsrep_applier.cc index 3f186d49860a7..fd71aac5b8b06 100644 --- a/sql/wsrep_applier.cc +++ b/sql/wsrep_applier.cc @@ -80,7 +80,7 @@ wsrep_get_apply_format(THD* thd) DBUG_ASSERT(thd->wsrep_rgi); - return thd->wsrep_rgi->rli->relay_log.description_event_for_exec; + return thd->wsrep_rgi->rli->relay_log.description_event_for_sql_thread; } /* store error from rli */ diff --git a/sql/wsrep_high_priority_service.cc b/sql/wsrep_high_priority_service.cc index 146c9ca213134..9515f74b686b7 100644 --- a/sql/wsrep_high_priority_service.cc +++ b/sql/wsrep_high_priority_service.cc @@ -68,9 +68,9 @@ static rpl_group_info* wsrep_relay_group_init(THD* thd, const char* log_fname) { Relay_log_info* rli= new Relay_log_info(false); - if (!rli->relay_log.description_event_for_exec) + if (!rli->relay_log.description_event_for_sql_thread) { - rli->relay_log.description_event_for_exec= + rli->relay_log.description_event_for_sql_thread= new Format_description_log_event(4, 0, BINLOG_CHECKSUM_ALG_OFF); }