diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log.cc | 2 | ||||
-rw-r--r-- | sql/log_event.cc | 38 | ||||
-rw-r--r-- | sql/log_event.h | 6 | ||||
-rw-r--r-- | sql/rpl_rli.cc | 2 |
4 files changed, 13 insertions, 35 deletions
diff --git a/sql/log.cc b/sql/log.cc index 6df9cea94b0..f8f4162cd44 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -5956,7 +5956,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate) /* When binary logging is not enabled (--log-bin=0), wsrep-patch partially - enables it without opening the binlog file (MSQL_BIN_LOG::open(). + enables it without opening the binlog file (MYSQL_BIN_LOG::open(). So, avoid writing to binlog file. */ if (direct && diff --git a/sql/log_event.cc b/sql/log_event.cc index a23bc17b157..831e632d207 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1157,8 +1157,7 @@ bool Log_event::write_footer(IO_CACHE* file) { DBUG_ENTER("write_footer"); /* - footer contains the checksum-algorithm descriptor - followed by the checksum value + (optional) footer contains the checksum value */ if (need_checksum()) { @@ -1171,7 +1170,7 @@ bool Log_event::write_footer(IO_CACHE* file) } /* - Log_event::write() + Log_event::write_header() */ bool Log_event::write_header(IO_CACHE* file, ulong event_data_length) @@ -1209,29 +1208,8 @@ bool Log_event::write_header(IO_CACHE* file, ulong event_data_length) else if (!log_pos) { /* - Calculate position of end of event - - Note that with a SEQ_READ_APPEND cache, my_b_tell() does not - work well. So this will give slightly wrong positions for the - Format_desc/Rotate/Stop events which the slave writes to its - relay log. For example, the initial Format_desc will have - end_log_pos=91 instead of 95. Because after writing the first 4 - bytes of the relay log, my_b_tell() still reports 0. Because - my_b_append() does not update the counter which my_b_tell() - later uses (one should probably use my_b_append_tell() to work - around this). To get right positions even when writing to the - relay log, we use the (new) my_b_safe_tell(). - - Note that this raises a question on the correctness of all these - DBUG_ASSERT(my_b_tell()=rli->event_relay_log_pos). - - If in a transaction, the log_pos which we calculate below is not - very good (because then my_b_safe_tell() returns start position - of the BEGIN, so it's like the statement was at the BEGIN's - place), but it's not a very serious problem (as the slave, when - it is in a transaction, does not take those end_log_pos into - account (as it calls inc_event_relay_log_pos()). To be fixed - later, so that it looks less strange. But not bug. + Calculate the position of where the next event will start + (end of this event, that is). */ log_pos= my_b_safe_tell(file)+data_written; @@ -1341,7 +1319,7 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet, file->error will have been set to number of bytes left to read 2. Read was interrupted, file->error would normally be set to -1 3. Failed to allocate memory for packet, my_errno - will be ENOMEM(file->error shuold be 0, but since the + will be ENOMEM(file->error should be 0, but since the memory allocation occurs before the call to read it might be uninitialized) */ @@ -2737,7 +2715,7 @@ void Query_log_event::pack_info(THD *thd, Protocol *protocol) /** Utility function for the next method (Query_log_event::write()) . */ -static void write_str_with_code_and_len(uchar **dst, const char *src, +static void store_str_with_code_and_len(uchar **dst, const char *src, uint len, uint code) { /* @@ -2833,7 +2811,7 @@ bool Query_log_event::write(IO_CACHE* file) } if (catalog_len) // i.e. this var is inited (false for 4.0 events) { - write_str_with_code_and_len(&start, + store_str_with_code_and_len(&start, catalog, catalog_len, Q_CATALOG_NZ_CODE); /* In 5.0.x where x<4 masters we used to store the end zero here. This was @@ -2871,7 +2849,7 @@ bool Query_log_event::write(IO_CACHE* file) { /* In the TZ sys table, column Name is of length 64 so this should be ok */ DBUG_ASSERT(time_zone_len <= MAX_TIME_ZONE_NAME_LENGTH); - write_str_with_code_and_len(&start, + store_str_with_code_and_len(&start, time_zone_str, time_zone_len, Q_TIME_ZONE_CODE); } if (lc_time_names_number) diff --git a/sql/log_event.h b/sql/log_event.h index 76108fcce0b..4866eb5f83b 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -1239,10 +1239,12 @@ public: write_data_body(file) || write_footer(file)); } - virtual bool write_data_header(IO_CACHE* file) + virtual bool write_data_header(IO_CACHE* file __attribute__((unused))) { return 0; } virtual bool write_data_body(IO_CACHE* file __attribute__((unused))) { return 0; } + + /* Return start of query time or current time */ inline my_time_t get_time() { THD *tmp_thd; @@ -1321,8 +1323,6 @@ public: */ const char* get_type_str(); - /* Return start of query time or current time */ - #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) public: diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index aba568ee317..e2a04cbd615 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1009,7 +1009,7 @@ void Relay_log_info::inc_group_relay_log_pos(ulonglong log_pos, group_relay_log_pos= event_relay_log_pos; strmake_buf(group_relay_log_name, event_relay_log_name); notify_group_relay_log_name_update(); - if (log_pos) // 3.23 binlogs don't have log_posx + if (log_pos) // not 3.23 binlogs (no log_pos there) and not Stop_log_event group_master_log_pos= log_pos; } |