Skip to content
/ server Public
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sql/log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
/*
Expand Down Expand Up @@ -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()))
{
Expand Down
4 changes: 3 additions & 1 deletion sql/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions sql/log_event_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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).
*/
Expand Down Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions sql/rpl_rli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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",
Expand All @@ -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));
Expand Down
14 changes: 7 additions & 7 deletions sql/slave.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -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]) ||
Expand Down Expand Up @@ -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)))

{
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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 ?
Expand Down Expand Up @@ -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]);
Expand Down
10 changes: 5 additions & 5 deletions sql/sql_binlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down
6 changes: 3 additions & 3 deletions sql/sql_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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");
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sql/wsrep_applier.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions sql/wsrep_high_priority_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down