From: Andrei Elkin Date: March 28 2011 3:44pm Subject: bzr commit into mysql-trunk branch (andrei.elkin:3327) Bug#11763265 List-Archive: http://lists.mysql.com/commits/134087 X-Bug: 11763265 Message-Id: <201103281544.p2SFix3e018644@mysql1000.dsl.inet.fi> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1496575444==" --===============1496575444== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #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-28 bug#11763265 Potential bug with new --raw mode with mysqlbinlog There are two reported artifacts on possible operations with uninitialazed Log_event* pointer inside dump_remote_log_entries(). In fact, under --raw mode only Load-data events generated by pre 5.0.3 servers is the valid issue. That relates to the assignment Load_log_event *le= (Load_log_event*)ev where rhs is not initialized when --raw. Rotate event is indeed handled correctly. Fixed with enforcing all events incl LOAD_EVENT, CREATE_FILE_EVENT to be dumped as raw_mode is supposed to do without instantiation of the event. In case of CREATE_FILE_EVENT another artifact is corrected to pass such event to re-formatting to yield an event of the latest binlog-format. Notice, in --raw mode mysqlbinlog does not copy the data file of LOAD DATA query that is does with just -R option, and that fact is warned. @ client/mysqlbinlog.cc In case not raw_mode LOAD_EVENT and CREATE_FILE_EVENT require conversion into the current load-data formats. In case of raw_mode all events including the two does 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-28 15:44:54 +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 && type != CREATE_FILE_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 || type == CREATE_FILE_EVENT) + { + DBUG_ASSERT(raw_mode); + warning("A remote pre-5.0 binary log that containig LOAD DATA INFILE " + "statements is dumped. The loaded file will not be copied from " + "the remote server."); + } if (raw_mode) { --===============1496575444== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/andrei.elkin@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: andrei.elkin@stripped # target_branch: file:///home/andrei/MySQL/BZR/2a-23May/FIXES\ # /bug11763265-55956-mysqlbinlog_raw_mode/ # testament_sha1: ac51425625cf3a6914da6126a531b39aab8c4068 # timestamp: 2011-03-28 18:44:59 +0300 # base_revision_id: georgi.kodinov@stripped\ # lw2g411ffimrgmtt # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWXj7fe0AAkpfgFQUeXf//3+l 3wC////+YAaXr3s87AW+RddrW7q3NS0rgkijQqfpplTYNJmppiTaGU8kGmanlPSAAeoBkTRMmmQj JPJGE0UHpPUekYmgaAAD0hFI/1TUfopkAGmjIAAAAAAAAGERNFNT2moyJiNPU0NMjQAGQ0AaABBS bU0BkaBoMg0aA0ABoZAaaYRhIoTTSZTNE1PFPFPEJ6gGgNAGmgAMQ/2oDh9eXbh71/P7P2HDnFKy 7vNMxWwdILkxCAhOU0dPpR9MxqT71UQETCASQz++WWh2/k+9RhOkKesxEQnuiY+ZoOtECmzfHfGN ltgv5+O0e0T9nLjGEk/rzyu2ylFt9UV2qhY/DsW5+wxULXMC6NhwI+7ub6bxowrOFfzWZvWKZsLI NIIKSHhurLh1AYNZBElABc4hwsZsP2kqaN6ugSFECzGQGeycQkw0JQE3ZTHr7t2bQiqJa6gdP4gO lnfh19Xbw5B3sUH1DDKi4qb0Hivikt+3jvEYcXswHDM+AIZ/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