#At file:///home/andrei/MySQL/BZR/2a-23May/FIXES/bug11763265-55956-mysqlbinlog_raw_mode/ based on revid:georgi.kodinov@stripped
3327 Andrei Elkin 2011-03-29
bug#11763265 Potential bug with new --raw mode with mysqlbinlog
There were two reported artifacts on possible operations with uninitialized Log_event* pointer
inside dump_remote_log_entries().
But only a case of pre-4.0 load-data LOAD_EVENT in --raw mode appears to be problematic.
The assignment
Load_log_event *le= (Load_log_event*)ev
has ev==NULL in that case whereas Rotate event is indeed handled correctly.
Fixed by enforcing all events incl LOAD_EVENT to be dumped as it's
supposed to be in the raw mode without reformating the events into load-date event
types of the latest binlog format.
CREATE_FILE_EVENT is eliminated from the load-data-needs-conversion check which is rather
sources code cleaup as checking was ineffective in that case anyway.
@ client/mysqlbinlog.cc
In case not raw_mode LOAD_EVENT of the 3.23 server version require conversion into the current load-data formats. In case of raw_mode all events including LOAD_EVENT do not need any extra treatment.
modified:
client/mysqlbinlog.cc
=== modified file 'client/mysqlbinlog.cc'
--- a/client/mysqlbinlog.cc 2011-01-18 12:09:03 +0000
+++ b/client/mysqlbinlog.cc 2011-03-29 08:04:37 +0000
@@ -1673,8 +1673,7 @@ static Exit_status dump_remote_log_entri
*/
ev->register_temp_buf((char *) net->read_pos + 1);
}
- if (glob_description_event->binlog_version >= 3 ||
- (type != LOAD_EVENT && type != CREATE_FILE_EVENT))
+ if (raw_mode || (type != LOAD_EVENT))
{
/*
If this is a Rotate event, maybe it's the end of the requested binlog;
@@ -1763,6 +1762,14 @@ static Exit_status dump_remote_log_entri
ev= 0;
}
}
+
+ if (type == LOAD_EVENT)
+ {
+ DBUG_ASSERT(raw_mode);
+ warning("Attempting to load a remote pre-4.0 binary log that contains "
+ "LOAD DATA INFILE statements. The file will not be copied from "
+ "the remote server. ");
+ }
if (raw_mode)
{
Attachment: [text/bzr-bundle] bzr/andrei.elkin@oracle.com-20110329080437-71zeup4daeogeqf5.bundle
| Thread |
|---|
| • bzr commit into mysql-trunk branch (andrei.elkin:3327) Bug#11763265 | Andrei Elkin | 29 Mar |