1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-04 17:23:46 +03:00

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
This commit is contained in:
unknown
2004-07-26 19:42:59 +02:00
parent 1876125e6d
commit 9b867a2a7f
4 changed files with 20 additions and 22 deletions

View File

@@ -418,18 +418,6 @@ Create_file event for file_id: %u\n",exv->file_id);
*/
ev= 0;
break;
case ROTATE_EVENT:
/* see comments in sql/slave.cc:process_io_rotate() */
if (description_event->binlog_version >= 4)
{
delete description_event;
/* start from format 3 (MySQL 4.0) again */
description_event= new Format_description_log_event(3);
if (!description_event || !description_event->is_valid())
die("Invalid Format_description log event; could be out of memory");
}
ev->print(result_file, short_form, last_event_info);
break;
default:
ev->print(result_file, short_form, last_event_info);
}
@@ -1011,11 +999,13 @@ static int dump_local_log_entries(const char* logname)
if (!ev)
{
if (file->error)
{
fprintf(stderr,
"Could not read entry at offset %s:"
"Error in log format or read error\n",
llstr(old_off,llbuff));
error= 1;
error= 1;
}
// file->error == 0 means EOF, that's OK, we break in this case
break;
}