summaryrefslogtreecommitdiff
path: root/sql/log_event.h
diff options
context:
space:
mode:
authorsven@riska.(none) <>2008-01-10 16:39:44 +0100
committersven@riska.(none) <>2008-01-10 16:39:44 +0100
commit617ea4d631e57704fcba39db8edbd0807d5adc04 (patch)
tree42fc54f94d65ce48cc3ddf5544da17d196b7a018 /sql/log_event.h
parentfabaa50cd969dc8be45cd3679389c4edef34e403 (diff)
downloadmariadb-git-617ea4d631e57704fcba39db8edbd0807d5adc04.tar.gz
BUG#27779: Slave cannot read old rows log events.
Problem: Replication fails when master is mysql-5.1-wl2325-5.0-drop6 and slave is mysql-5.1-new-rpl. The reason is that, in mysql-5.1-wl2325-5.0-drop6, the event type id's were different than in mysql-5.1-new-rpl. Fix (in mysql-5.1-new-rpl): (1) detect that the server that generated the events uses the old format, by checking the server version of the format_description_log_event This patch recognizes mysql-5.1-wl2325-5.0-drop6p13-alpha, mysql-5.1-wl2325-5.0-drop6, mysql-5.1-wl2325-5.0, mysql-5.1-wl2325-no-dd. (2) if the generating server is old, map old event types to new event types using a permutation array. I've also added a test case which reads binlogs for four different versions.
Diffstat (limited to 'sql/log_event.h')
-rw-r--r--sql/log_event.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/log_event.h b/sql/log_event.h
index 4a75f330203..31c1ab7173a 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -2106,12 +2106,16 @@ public:
/* The list of post-headers' lengthes */
uint8 *post_header_len;
uchar server_version_split[3];
+ const uint8 *event_type_permutation;
Format_description_log_event(uint8 binlog_ver, const char* server_ver=0);
Format_description_log_event(const char* buf, uint event_len,
const Format_description_log_event
*description_event);
- ~Format_description_log_event() { my_free((uchar*)post_header_len, MYF(0)); }
+ ~Format_description_log_event()
+ {
+ my_free((uchar*)post_header_len, MYF(MY_ALLOW_ZERO_PTR));
+ }
Log_event_type get_type_code() { return FORMAT_DESCRIPTION_EVENT;}
#ifndef MYSQL_CLIENT
bool write(IO_CACHE* file);