diff options
author | unknown <knielsen@knielsen-hq.org> | 2013-05-24 22:21:08 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2013-05-24 22:21:08 +0200 |
commit | 416aed25ed2c27acbc47ec695fda023981be53c8 (patch) | |
tree | 9d7f0cbe5c9192cd70e6c98fb593f42bf0dbb5d5 /sql/log_event.h | |
parent | 1cd6eb5f942ca3e94e86a48512d992fbb3aeecd9 (diff) | |
download | mariadb-git-416aed25ed2c27acbc47ec695fda023981be53c8.tar.gz |
MDEV-4475: Replication from MariaDB 10.0 to 5.5 does not work
The problem was the Gtid_list event which is logged to the binlog in
10.0 and is not understood by the 5.5 server.
This event is supposed to be replaced with a dummy event for 5.5
servers. But the very first event logged in the very first binlog
has an empty list of GTID, which makes the event too short to be
replacable with an empty event.
The fix is to pad the empty Gtid_list event to be big enough to
be replacable by a dummy event.
Diffstat (limited to 'sql/log_event.h')
-rw-r--r-- | sql/log_event.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/log_event.h b/sql/log_event.h index 21d60cac928..b5b488f320d 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -3181,7 +3181,14 @@ public: const Format_description_log_event *description_event); ~Gtid_list_log_event() { my_free(list); } Log_event_type get_type_code() { return GTID_LIST_EVENT; } - int get_data_size() { return GTID_LIST_HEADER_LEN + count*element_size; } + int get_data_size() { + /* + Replacing with dummy event, needed for older slaves, requires a minimum + of 6 bytes in the body. + */ + return (count==0 ? + GTID_LIST_HEADER_LEN+2 : GTID_LIST_HEADER_LEN+count*element_size); + } bool is_valid() const { return list != NULL; } #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) bool to_packet(String *packet); |