diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-08-17 18:38:30 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-09-04 10:33:50 +0200 |
commit | 5018a6606f1c863b197812e3f3c1b8b18134c638 (patch) | |
tree | fdfb6737e92871095ba31dc30f1fb4a9641abc13 /sql/sql_repl.cc | |
parent | 08687f7ef3ccb59ca78a3d037e9db5a514145d64 (diff) | |
download | mariadb-git-5018a6606f1c863b197812e3f3c1b8b18134c638.tar.gz |
cleanup: Log_event::read_log_event()
There are three Log_event::read_log_event() methods:
1. read the event image from IO_CACHE into String
2. create Log_event from the in-memory event image
3. read the event image from IO_CACHE and create Log_event
The 3rd was reading event image into memory and invoking the 2nd to
create Log_event. Now the 3rd also uses the 1st to read the event image
from IO_CACHE into memory, instead of duplicating its functionality.
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r-- | sql/sql_repl.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 50177b94d9e..a56047db63e 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1436,8 +1436,9 @@ gtid_state_from_pos(const char *name, uint32 offset, break; packet.length(0); - err= Log_event::read_log_event(&cache, &packet, NULL, - current_checksum_alg); + err= Log_event::read_log_event(&cache, &packet, + opt_master_verify_checksum + ? current_checksum_alg : 0); if (err) { errormsg= "Could not read binlog while searching for slave start " @@ -2230,8 +2231,9 @@ static int send_format_descriptor_event(binlog_send_info *info, the binlog */ info->last_pos= my_b_tell(log); - error= Log_event::read_log_event(log, packet, /* LOCK_log */ NULL, - info->current_checksum_alg); + error= Log_event::read_log_event(log, packet, + opt_master_verify_checksum + ? info->current_checksum_alg : 0); linfo->pos= my_b_tell(log); if (error) @@ -2566,9 +2568,9 @@ static int send_events(binlog_send_info *info, return 1; info->last_pos= linfo->pos; - error = Log_event::read_log_event(log, packet, /* LOCK_log */ NULL, - info->current_checksum_alg, - NULL, NULL); + error= Log_event::read_log_event(log, packet, + opt_master_verify_checksum + ? info->current_checksum_alg : 0); linfo->pos= my_b_tell(log); if (error) |