List:Commits« Previous MessageNext Message »
From:Luís Soares Date:May 5 2011 10:39am
Subject:Re: bzr commit into mysql-5.1 branch (luis.soares:3629) Bug#12354268
View as plain text  
Hi Sven,

On 05/05/2011 10:14 AM, Sven Sandberg wrote:
> Hi Luís,
>
> Thanks for pushing this. The patch is good and the test case is simple enough. I
> think the test case can be made even
> simpler though:
>
> (1) We only need one table: t2 can be removed.

OK.

> (2) We don't have to create and delete a temporary file to get rid
> of output, it's enough to do:
> --disable_query_log
> --exec $MYSQL_BINLOG ...
> --enable_query_log

Agreed, but it's disable_result_log instead of disable_query_log ;). Thanks.

> Fix this if you like, but it's ok if you push the patch as it is too. I'll tick the
> reviewed box.

FYI, your suggested changes were considered:
- http://lists.mysql.com/commits/136731 .

Regards,
Luís

> /Sven
>
>
> On 04/28/2011 03:45 PM, Luis Soares wrote:
>> #At file:///home/lsoares/Workspace/bzr/work/bugfixing/12354268/mysql-5.1/ based
> on
>> revid:luis.soares@stripped
>>
>> 3629 Luis Soares 2011-04-28
>> BUG#12354268: MYSQLBINLOG --BASE64-OUTPUT=DECODE-ROWS DOES NOT
>> WORK WITH --START-POSITION
>>
>> If setting --start-position to start after the FD event, mysqlbinlog
>> will output an error stating that it has not found an FD event.
>> However, its not that mysqlbinlog does not find it but rather that it
>> does not processes it in the regular way (i.e., it does not print it).
>> Given that one is using --base64-output=DECODE-ROWS then not printing
>> it is actually fine.
>>
>> To fix this, we make mysqlbinlog not to complain when it has not
>> printed the FD event, is outputing in base64, but is decoding the
>> rows.
>> @ mysql-test/t/mysqlbinlog_base64.test
>> Added test case.
>>
>> modified:
>> client/mysqlbinlog.cc
>> mysql-test/r/mysqlbinlog_base64.result
>> mysql-test/t/mysqlbinlog_base64.test
>> === modified file 'client/mysqlbinlog.cc'
>> --- a/client/mysqlbinlog.cc 2010-07-09 12:00:17 +0000
>> +++ b/client/mysqlbinlog.cc 2011-04-28 13:45:37 +0000
>> @@ -943,7 +943,8 @@ Exit_status process_event(PRINT_EVENT_IN
>> passed --short-form, because --short-form disables printing
>> row events.
>> */
>> - if (!print_event_info->printed_fd_event&& !short_form)
>> + if (!print_event_info->printed_fd_event&& !short_form&&
>> + opt_base64_output_mode != BASE64_OUTPUT_DECODE_ROWS)
>> {
>> const char* type_str= ev->get_type_str();
>> if (opt_base64_output_mode == BASE64_OUTPUT_NEVER)
>>
>> === modified file 'mysql-test/r/mysqlbinlog_base64.result'
>> --- a/mysql-test/r/mysqlbinlog_base64.result 2008-07-28 07:15:20 +0000
>> +++ b/mysql-test/r/mysqlbinlog_base64.result 2011-04-28 13:45:37 +0000
>> @@ -109,3 +109,15 @@ count(*)
>> 35840
>> drop table t1;
>> drop table t2;
>> +RESET MASTER;
>> +USE test;
>> +SET @old_binlog_format= @@binlog_format;
>> +SET SESSION binlog_format=ROW;
>> +CREATE TABLE t1(c1 INT);
>> +CREATE TABLE t2(c1 INT);
>> +INSERT INTO t1 VALUES (1);
>> +INSERT INTO t2 VALUES (2);
>> +FLUSH LOGS;
>> +DROP TABLE t1, t2;
>> +SET SESSION binlog_format= @old_binlog_format;
>> +RESET MASTER;
>>
>> === modified file 'mysql-test/t/mysqlbinlog_base64.test'
>> --- a/mysql-test/t/mysqlbinlog_base64.test 2008-07-28 07:15:20 +0000
>> +++ b/mysql-test/t/mysqlbinlog_base64.test 2011-04-28 13:45:37 +0000
>> @@ -71,3 +71,38 @@ select count(*) from t2;
>> --remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
>> drop table t1;
>> drop table t2;
>> +
>> +#
>> +# BUG#12354268
>> +#
>> +# This test verifies that using --start-position with DECODE-ROWS
>> +# does not make mysqlbinlog to output an error stating that it
>> +# does not contain any FD event.
>> +#
>> +
>> +RESET MASTER;
>> +USE test;
>> +SET @old_binlog_format= @@binlog_format;
>> +SET SESSION binlog_format=ROW;
>> +CREATE TABLE t1(c1 INT);
>> +CREATE TABLE t2(c1 INT);
>> +--let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
>> +--let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
>> +--let $MYSQLD_DATADIR= `SELECT @@datadir`
>> +
>> +--let $tmp_fname= `SELECT UUID()`
>> +--let $tmp_file= $MYSQLTEST_VARDIR/tmp/$tmp_fname
>> +
>> +INSERT INTO t1 VALUES (1);
>> +INSERT INTO t2 VALUES (2);
>> +
>> +FLUSH LOGS;
>> +
>> +--exec $MYSQL_BINLOG --base64-output=DECODE-ROWS --start-position=$master_pos -v
> $MYSQLD_DATADIR/$master_binlog>
>> $tmp_file
>> +
>> +# we don't need the tmp file anymore
>> +--remove_file $tmp_file
>> +
>> +DROP TABLE t1, t2;
>> +SET SESSION binlog_format= @old_binlog_format;
>> +RESET MASTER;
>>
>>
>>
>>
>>
>

Thread
bzr commit into mysql-5.1 branch (luis.soares:3629) Bug#12354268Luis Soares28 Apr
  • Re: bzr commit into mysql-5.1 branch (luis.soares:3629) Bug#12354268Sven Sandberg5 May
    • Re: bzr commit into mysql-5.1 branch (luis.soares:3629) Bug#12354268Luís Soares5 May