Commit 038d2925 authored by Kristian Nielsen's avatar Kristian Nielsen

Fix redundant call to update_binlog_end_pos() (probably merge error).

Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
parent f612e1c2
...@@ -7767,15 +7767,19 @@ MYSQL_BIN_LOG:: ...@@ -7767,15 +7767,19 @@ MYSQL_BIN_LOG::
write_binlog_checkpoint_event_already_locked(const char *name_arg, uint len) write_binlog_checkpoint_event_already_locked(const char *name_arg, uint len)
{ {
my_off_t offset; my_off_t offset;
bool err;
Binlog_checkpoint_log_event ev(name_arg, len); Binlog_checkpoint_log_event ev(name_arg, len);
/* /*
Note that we must sync the binlog checkpoint to disk. Note that we must sync the binlog checkpoint to disk.
Otherwise a subsequent log purge could delete binlogs that XA recovery Otherwise a subsequent log purge could delete binlogs that XA recovery
thinks are needed (even though they are not really). thinks are needed (even though they are not really).
*/ */
if (!write_event(&ev) && !flush_and_sync(0)) err= write_event(&ev) || flush_and_sync(0);
offset= my_b_tell(&log_file);
if (!err)
{ {
update_binlog_end_pos(); update_binlog_end_pos(offset);
} }
else else
{ {
...@@ -7790,10 +7794,6 @@ write_binlog_checkpoint_event_already_locked(const char *name_arg, uint len) ...@@ -7790,10 +7794,6 @@ write_binlog_checkpoint_event_already_locked(const char *name_arg, uint len)
sql_print_error("Failed to write binlog checkpoint event to binary log"); sql_print_error("Failed to write binlog checkpoint event to binary log");
} }
offset= my_b_tell(&log_file);
update_binlog_end_pos(offset);
/* /*
Take mutex to protect against a reader seeing partial writes of 64-bit Take mutex to protect against a reader seeing partial writes of 64-bit
offset on 32-bit CPUs. offset on 32-bit CPUs.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment