diff options
author | unknown <guilhem@mysql.com> | 2004-07-26 19:42:59 +0200 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2004-07-26 19:42:59 +0200 |
commit | 9b867a2a7f4943f056b37ecc9266ef136a1118f6 (patch) | |
tree | 85dbfd1b8eb1d558ee6c61ab913f8f811f4d1d4d /sql/slave.cc | |
parent | 1876125e6d8f89460e14418ca8e2e7ffaafbdb32 (diff) | |
download | mariadb-git-9b867a2a7f4943f056b37ecc9266ef136a1118f6.tar.gz |
Replication: various small fixes specific to the new binlog format of 5.0
(including one which may explain autobuild's failure of yesterday)
client/mysqlbinlog.cc:
- In mysqlbinlog, we should not reset the Format event when we see Rotate. If a binlog started with a Format event, it is not going to switch later to 4.0 format.
I had already did the same fix in Rotate_log_event::exec_event() in replication.
- Fix for a merge bug.
sql/log_event.cc:
An event with an uninited catalog (read from a 4.x server) is not the same as an event with a NULL catalog
(5.0 server which did not specify catalog), the difference is that they are not in the same format;
so I introduce a way to know if the catalog has been inited or not. This fixes a rpl_trunc_binlog failure
I had.
When we leave Load_log_event::exec_event(), we must reset thd->catalog to 0, like we already do
in Query_log_event::exec_event(). This fixes a Valgrind error which popped in rpl_charset (which may
be what caused autobuild to crash yesterday).
And a fix for event's parsing (the position was always computed right because start_dup==end is always true
and will until we add new string members to Query_log_event.
sql/log_event.h:
catalog_len changed from uint to int to allow -1, which means "not inited"
(I preferred to do it like this rather than create a new bool var Query_log_event::catalog_inited
like we have in Query_log_event::sql_mode_inited; that's because catalog will not use the whole range of int,
so it's allowed to pick -1 as a special value and have only one var.
sql/slave.cc:
comments
Diffstat (limited to 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index 8899635e2c6..8843e1561ec 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -372,7 +372,7 @@ int init_relay_log_pos(RELAY_LOG_INFO* rli,const char* log, (starting from position 4): Format_desc (of slave) Rotate (of master) - Format_desc (of slave) + Format_desc (of master) So the Format_desc which really describes the rest of the relay log is the 3rd event (it can't be further than that, because we rotate the relay log when we queue a Rotate event from the master). @@ -3873,7 +3873,10 @@ static int process_io_rotate(MASTER_INFO *mi, Rotate_log_event *rev) mi->rli.relay_log.description_event_for_queue= new Format_description_log_event(3); } - + /* + Rotate the relay log makes binlog format detection easier (at next slave + start or mysqlbinlog) + */ rotate_relay_log(mi); /* will take the right mutexes */ DBUG_RETURN(0); } |