List:Commits« Previous MessageNext Message »
From:Luís Soares Date:July 13 2010 11:26am
Subject:Re: bzr commit into mysql-next-mr branch (Dao-Gang.Qu:3166) WL#5404
View as plain text  
Hi Dao-Gang,

On 7/13/10 8:35 AM, Daogang Qu wrote:
> Hi Luis,
> Thanks for your comments. Most are applied. See response in-line.
> Please review the updated patch:
> http://lists.mysql.com/commits/113425
>
> Best Regards,
>
> Daogang
>
> Luís Soares wrote:
>> Hi Dao-Gang,
>>
>> Nice Work. But I need you to clarify some points, fix others
>> and add more tests. Please find my review comments below.
>>
>> STATUS
>> ------
>>
>> Not approved.
>>
>> REQUIRED CHANGES
>> ----------------
>>
>> RC1. Where is the chained replication scenario ;) ? I want a
>> chain with three hosts: m -> s1 -> s2. You can have a look
>> at the circular replication tests to check how to set it
>> up in MTR.
>>
> The Rows_query log event is executed and written into binlog
> with its rows events on slave as it's written into binlog on
> master, which verified that it can be relayed on a replication
> chain. So Jasonh and I don't think it's necessary to create
> chained replication scenario with three hosts. What's your
> concern?

Hmm... Just to get coverage...
Ok, if you both agree, I am willing to not make this mandatory.

>> REQUESTS
>> --------
>>
>> R1. Shouldn't we take care of those cases that the SQL thread
>> is stopped before executing a rows event, but after
>> executing a rows_query_log_event, and then it gets started
>> from some other position? Wouldn't this lead to a leak? Can
>> you please have a look at
>>
>> void Relay_log_info::cleanup_context(THD *thd, bool error)
>>
>> to check what happens with table map events. I am guessing
>> we need to address similar cases for the
>> rows_query_log_event.
> Yes. We should clear the last Rows_query log event in the 'cleanup_context'
> function when the SQL thread is stopped before executing its rows event.

Good.

> But we don't need simulate table map event, one statement can include multi
> table map events and multi rows event, but it just can include one single
> Rows_query log event. So it's OK to clear the last Rows_query log event recorded
> in Relay_log_info.

Yeah. I was not referring to that... Just stating that the problem
might be similar to the one for table map log events. I think
clearing it in cleanup_context should suffice.

>>
>> Moreover, what happens if the user skips the event that has
>> the STMT_END_F? What happens then? Will there be memory
>> left around, allocated but not referenced? We need tests,
>> so that we give a chance to valgrind to check this.
> No memory left around by DBUG check.
>
> I have tested the case in the committed test file as following:
> update t3,t4 set t3.a=3, t4.a=4 where t3.b=t4.b;
>
> On master:
>
> master-bin.000001 # Query # # BEGIN
> master-bin.000001 # Rows_query # # # update t3,t4 set t3.a=3, t4.a=4 where t3.b=t4.b
> master-bin.000001 # Table_map # # table_id: # (test.t3)
> master-bin.000001 # Table_map # # table_id: # (test.t4)
> master-bin.000001 # Update_rows # # table_id: #
> master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
> master-bin.000001 # Query # # COMMIT
>
> On slave:
>
> slave-bin.000001 # Query # # BEGIN
> slave-bin.000001 # Rows_query # # # update t3,t4 set t3.a=3, t4.a=4 where t3.b=t4.b
> slave-bin.000001 # Table_map # # table_id: # (test.t3)
> slave-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
> slave-bin.000001 # Query # # COMMIT

Yes, but I meant, what if the user skips it with SQL_SLAVE_SKIP_COUNTER,
and then just replays another rows_query_log_event? Looking at
handle_rows_query_log_event from the new patch, it just assigns it
to the rli field:

+    rli->rows_query_ev= (Rows_query_log_event*) ev;

So, if user skips one event with STMT_END_F, applies a commit event (eg,
Xid_log_event) and then processes the next rows_query_log_event... Will
this make the first rows_query_log_event be left allocated and
unreferenced? My guess, is that it wont because we now deployed the free
in cleanup_context.

What if we introduce a DBUG_ASSERTION just before the assignment, just
in case (and to be future proof)? I think this would do the trick:

     DBUG_ASSERT(rli->rows_query_ev == NULL);
     rli->rows_query_ev= (Rows_query_log_event*) ev;

>>
>> R2. Still in delete_log_event and wrt resetting the ev
>> pointer... I think that technically, the correct would be
>> to have:
>>
>> +void delete_log_event(Log_event **ev, Relay_log_info *rli)
>>
>> Note the double ** in ev, so that inside delete_log_event,
>> this assignment:
>>
>> ev= NULL;
>>
>> becomes:
>>
>> *ev= NULL;
>>
>> And thence original pointer gets it's value changed. Please
>> check if this makes a difference, IIRC, delete
>> specification does not state whether it resets the pointer
>> or not, thence it may be system dependent.
>>
>> Judging from hunk: @@ -273,15 +274,9 @@ void mysql_client...
>> it may be that ev really needs to be set to NULL.
> Updated by another way.

Yes, I see it, good.

>>
>> R3. In sql/log_event.cc, hunk @@ -9750,8 +9793,14 @@ Rows_...
>>
>> + ulong len= sizeof("# ") + (ulong) strlen(m_rows_query) + 1;
>>
>> Do you really mean sizeof? I think that in this case
>> sizeof("# ") will return 3, right? Is this intended?
> No. Updated. Thanks!

OK. I can live with the sizeof, given jasonh's argument that it
is calculated at compile time, it makes sense.

>>
>> R4. This is a request for clarification...
>>
>> I can't find any interaction between the
>> --binlog-row-event-max-size parameter and the relaying of
>> the rows_query_log_event... If I don't set this parameter,
>> will the slave still relay it ? If so, why? If not, I think
>> that's good. Basically, I am asking whether
>> --binlog-row-event-max-size affects SQL thread (I actually
>> think it should). Did you discuss this with the
>> architecture reviewer?
> Yes. Jasonh recommended to do it as following:
>
> R2. Please do not add a new word3.data file, please considering change
> the value of '--binlog-row-event-max-size' so that the load data
> statement can be logged in two rows.
>

My bad, I meant binlog-rows-query-log-events and not
binlog-row-event-max-size. I see that the option is actually checked at

    write_locked_table_map()

But I wonder if we could save some cpu cycles (not that many, but anyway)
if we check if in handle_rows_query_log_event (from the new patch).

So, to sum it up:

   1. please, deploy the assertion;
   2. please, check if verifying the option in handle_rows_query_log_event
      is worth;
   3. you're free to implement or not the chained replication test.

Thanks,
Luís

>>
>> SUGGESTIONS
>> -----------
>>
>> S1. In sql/log_event.cc, hunk: @@ -126,6 +126,49 @@ static
>>
>> Why did you introduce this aux function? Why did you name
>> it delete_log_event? The name is a bit misleading,
>> sometimes it deletes, sometimes it records events . I would
>> split it into two functions:
>>
>> 1. handle_rows_query_log_event.
>> 2. delete_log_event.
> I think the handle_rows_query_log_event is enough.

Good.

>>
>> DETAILS
>> -------
>> n/a
>>
>> On 7/12/10 8:00 AM, Dao-Gang.Qu@stripped wrote:
>>> #At file:///home/daogangqu/mysql/bzrwork1/wl5404/mysql-next-mr-wl4033/ based
> on
>>> revid:dao-gang.qu@stripped
>>>
>>> 3166 Dao-Gang.Qu@stripped 2010-07-12
>>> WL#5404 Propagation of Rows_query log event when using a relay
>>>
>>> Rows_query was introduced to record the original query for rows events
>>> in RBR, but the Rows query will be lost when replicating on slave or
>>> re-applying the statments dumped by mysqlbinlog. This worklog will fix
>>> that.
>>> @ mysql-test/suite/rpl/r/rpl_ignorable_event.result
>>> Test result for WL#5404.
>>> @ mysql-test/suite/rpl/t/rpl_ignorable_event-master.opt
>>> Added the file to set the value of '--binlog-row-event-max-size',
>>> so that the load data statement can be logged in two rows and
>>> test that the Rows_query log event will work fine with the case.
>>> @ mysql-test/suite/rpl/t/rpl_ignorable_event-slave.opt
>>> Added the file to test replicate filter rules.
>>> @ mysql-test/suite/rpl/t/rpl_ignorable_event.test
>>> Added test to verify if the Rows_query log event can be
>>> applied and relayed.
>>> @ sql/log_event.cc
>>> Added code to make that the Rows_query log event can be applied
>>> and relayed
>>> @ sql/rpl_slave.cc
>>> Added code to invoke 'delete_log_event' func to delay to delete the
>>> Rows_query log event untill all its rows event is applied on slave
>>> side
>>> @ sql/sql_binlog.cc
>>> Added code to invoke 'delete_log_event' func to delay to delete the
>>> Rows_query log event untill all its rows event is applied on server
>>> side
>>>
>>> added:
>>> mysql-test/suite/rpl/r/rpl_ignorable_event.result
>>> mysql-test/suite/rpl/t/rpl_ignorable_event-master.opt
>>> mysql-test/suite/rpl/t/rpl_ignorable_event-slave.opt
>>> mysql-test/suite/rpl/t/rpl_ignorable_event.test
>>> modified:
>>> sql/log_event.cc
>>> sql/log_event.h
>>> sql/rpl_rli.cc
>>> sql/rpl_rli.h
>>> sql/rpl_slave.cc
>>> sql/sql_binlog.cc
>>> === added file 'mysql-test/suite/rpl/r/rpl_ignorable_event.result'
>>> --- a/mysql-test/suite/rpl/r/rpl_ignorable_event.result 1970-01-01 00:00:00
> +0000
>>> +++ b/mysql-test/suite/rpl/r/rpl_ignorable_event.result 2010-07-12 06:59:55
> +0000
>>> @@ -0,0 +1,962 @@
>>> +stop slave;
>>> +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
>>> +reset master;
>>> +reset slave;
>>> +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
>>> +start slave;
>>> +# Test non-transaction
>>> +create table t1(a int, b int) engine= myisam;
>>> +insert into t1(a,b) values(1,1),(2,1);
>>> +update t1 set a = a + 5 where b = 1 LIMIT 1;
>>> +delete from t1 where a = 6;
>>> +# Test transaction
>>> +create table t2(a int, b int) engine=innodb;
>>> +begin;
>>> +insert into t2(a,b) values(2,1),(3,1);
>>> +update t2 set a = a + 5 where b = 1;
>>> +delete from t2 where a = 7;
>>> +commit;
>>> +# Test mixed transaction
>>> +begin;
>>> +insert into t1(a,b) values(1,5);
>>> +insert into t2(a,b) values(2,5);
>>> +insert into t2(a,b) values(2,6);
>>> +insert into t1(a,b) values(1,7);
>>> +commit;
>>> +drop table t1, t2;
>>> +create table t3(a int, b int) engine= myisam;
>>> +create table t4(a int, b int) engine= myisam;
>>> +create table t5(a int, b int) engine= myisam;
>>> +insert into t3(a, b) values(1,1);
>>> +# Test the Rows_query log event will be filtered out if slave applys
>>> +# '--replicate-ignore-table' option on the table
>>> +insert into t4(a, b) values(2,1);
>>> +# Test the Rows_query log event will be relayed if slave
>>> +# filters out part Rows event from a rows statement
>>> +update t3,t4 set t3.a=3, t4.a=4 where t3.b=t4.b;
>>> +# Test the Rows_query log event will be filtered out if slave applys
>>> +# '--replicate-wild-ignore-table' option on the table
>>> +insert into t5(a, b) values(3,1);
>>> +# Test the Rows_query log event will be filtered out if slave filters
>>> +# out all its related tables by replication filtering rules
>>> +update t4,t5 set t4.a=4, t5.a=5 where t4.b=t5.b;
>>> +# Test insert delayed ...
>>> +insert delayed into t3(a,b) values(1,5),(1,6),(1,7);
>>> +# Test load data infile
>>> +create table t6(a VARCHAR(60)) engine= myisam;
>>> +load data infile '../../std_data/words.dat' into table t6;
>>> +drop table t3, t6;
>>> +drop table t4, t5;
>>> +# SHOW BINLOG EVENTS ON MASTER before '--exec MYSQL_BINLOG'
>>> +show binlog events from<binlog_start>;
>>> +Log_name Pos Event_type Server_id End_log_pos Info
>>> +master-bin.000001 # Query # # use `test`; create table t1(a int, b int)
> engine= myisam
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # insert into t1(a,b) values(1,1),(2,1)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # update t1 set a = a + 5 where b = 1
> LIMIT 1
>>> +master-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # delete from t1 where a = 6
>>> +master-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # use `test`; create table t2(a int, b int)
> engine=innodb
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # insert into t2(a,b) values(2,1),(3,1)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Rows_query # # # update t2 set a = a + 5 where b = 1
>>> +master-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Rows_query # # # delete from t2 where a = 7
>>> +master-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Xid # # COMMIT /* XID */
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # insert into t1(a,b) values(1,5)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # insert into t1(a,b) values(1,7)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # insert into t2(a,b) values(2,5)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Rows_query # # # insert into t2(a,b) values(2,6)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Xid # # COMMIT /* XID */
>>> +master-bin.000001 # Query # # use `test`; drop table t1, t2
>>> +master-bin.000001 # Query # # use `test`; create table t3(a int, b int)
> engine= myisam
>>> +master-bin.000001 # Query # # use `test`; create table t4(a int, b int)
> engine= myisam
>>> +master-bin.000001 # Query # # use `test`; create table t5(a int, b int)
> engine= myisam
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # insert into t3(a, b) values(1,1)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t3)
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # insert into t4(a, b) values(2,1)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t4)
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # update t3,t4 set t3.a=3, t4.a=4 where
> t3.b=t4.b
>>> +master-bin.000001 # Table_map # # table_id: # (test.t3)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t4)
>>> +master-bin.000001 # Update_rows # # table_id: #
>>> +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # insert into t5(a, b) values(3,1)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t5)
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # update t4,t5 set t4.a=4, t5.a=5 where
> t4.b=t5.b
>>> +master-bin.000001 # Table_map # # table_id: # (test.t4)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t5)
>>> +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # insert delayed into t3(a,b)
> values(1,5),(1,6),(1,7)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t3)
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # use `test`; create table t6(a VARCHAR(60))
> engine= myisam
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # load data infile
> '../../std_data/words.dat' into table t6
>>> +master-bin.000001 # Table_map # # table_id: # (test.t6)
>>> +master-bin.000001 # Write_rows # # table_id: #
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # use `test`; drop table t3, t6
>>> +master-bin.000001 # Query # # use `test`; drop table t4, t5
>>> +# MYSQL_BINLOG output base on master-bin.000001
>>> +/*!40019 SET @@session.max_insert_delayed_threads=0*/;
>>> +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
>>> +DELIMITER /*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Start: binlog v#, server v #.##.## created #
> #:#:# at startup
>>> +# Warning: this binlog is either in use or was not closed properly.
>>> +ROLLBACK/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +use test/*!*/;
>>> +SET TIMESTAMP=t/*!*/;
>>> +SET @@session.pseudo_thread_id=#/*!*/;
>>> +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0,
> @@session.unique_checks=1,
>>> @@session.autocommit=1/*!*/;
>>> +SET @@session.sql_mode=0/*!*/;
>>> +SET @@session.auto_increment_increment=1,
> @@session.auto_increment_offset=1/*!*/;
>>> +/*!\C latin1 *//*!*/;
>>> +SET
> @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
>>> +SET @@session.lc_time_names=0/*!*/;
>>> +SET @@session.collation_database=DEFAULT/*!*/;
>>> +create table t1(a int, b int) engine= myisam
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +BEGIN
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# insert into t1(a,b) values(1,1),(2,1)
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t1` mapped to number #
>>> +#server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
>>> +### INSERT INTO test.t1
>>> +### SET
>>> +### @1=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t1
>>> +### SET
>>> +### @1=2 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +COMMIT
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +BEGIN
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# update t1 set a = a + 5 where b = 1 LIMIT 1
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t1` mapped to number #
>>> +#server id # end_log_pos # Update_rows: table id # flags: STMT_END_F
>>> +### UPDATE test.t1
>>> +### WHERE
>>> +### @1=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### SET
>>> +### @1=6 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +COMMIT
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +BEGIN
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# delete from t1 where a = 6
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t1` mapped to number #
>>> +#server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
>>> +### DELETE FROM test.t1
>>> +### WHERE
>>> +### @1=6 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +COMMIT
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +create table t2(a int, b int) engine=innodb
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +BEGIN
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# insert into t2(a,b) values(2,1),(3,1)
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t2` mapped to number #
>>> +#server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
>>> +### INSERT INTO test.t2
>>> +### SET
>>> +### @1=2 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t2
>>> +### SET
>>> +### @1=3 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# update t2 set a = a + 5 where b = 1
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t2` mapped to number #
>>> +#server id # end_log_pos # Update_rows: table id # flags: STMT_END_F
>>> +### UPDATE test.t2
>>> +### WHERE
>>> +### @1=2 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### SET
>>> +### @1=7 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### UPDATE test.t2
>>> +### WHERE
>>> +### @1=3 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### SET
>>> +### @1=8 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# delete from t2 where a = 7
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t2` mapped to number #
>>> +#server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
>>> +### DELETE FROM test.t2
>>> +### WHERE
>>> +### @1=7 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Xid = #
>>> +COMMIT/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +BEGIN
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# insert into t1(a,b) values(1,5)
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t1` mapped to number #
>>> +#server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
>>> +### INSERT INTO test.t1
>>> +### SET
>>> +### @1=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=5 /* INT meta=0 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +COMMIT
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +BEGIN
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# insert into t1(a,b) values(1,7)
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t1` mapped to number #
>>> +#server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
>>> +### INSERT INTO test.t1
>>> +### SET
>>> +### @1=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=7 /* INT meta=0 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +COMMIT
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +BEGIN
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# insert into t2(a,b) values(2,5)
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t2` mapped to number #
>>> +#server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
>>> +### INSERT INTO test.t2
>>> +### SET
>>> +### @1=2 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=5 /* INT meta=0 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# insert into t2(a,b) values(2,6)
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t2` mapped to number #
>>> +#server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
>>> +### INSERT INTO test.t2
>>> +### SET
>>> +### @1=2 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=6 /* INT meta=0 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Xid = #
>>> +COMMIT/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +drop table t1, t2
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +create table t3(a int, b int) engine= myisam
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +create table t4(a int, b int) engine= myisam
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +create table t5(a int, b int) engine= myisam
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +BEGIN
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# insert into t3(a, b) values(1,1)
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t3` mapped to number #
>>> +#server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
>>> +### INSERT INTO test.t3
>>> +### SET
>>> +### @1=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +COMMIT
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +BEGIN
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# insert into t4(a, b) values(2,1)
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t4` mapped to number #
>>> +#server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
>>> +### INSERT INTO test.t4
>>> +### SET
>>> +### @1=2 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +COMMIT
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +BEGIN
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# update t3,t4 set t3.a=3, t4.a=4 where t3.b=t4.b
>>> +# at #
>>> +# at #
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t3` mapped to number #
>>> +#server id # end_log_pos # Table_map: `test`.`t4` mapped to number #
>>> +#server id # end_log_pos # Update_rows: table id #
>>> +#server id # end_log_pos # Update_rows: table id # flags: STMT_END_F
>>> +### UPDATE test.t3
>>> +### WHERE
>>> +### @1=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### SET
>>> +### @1=3 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### UPDATE test.t4
>>> +### WHERE
>>> +### @1=2 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### SET
>>> +### @1=4 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +COMMIT
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +BEGIN
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# insert into t5(a, b) values(3,1)
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t5` mapped to number #
>>> +#server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
>>> +### INSERT INTO test.t5
>>> +### SET
>>> +### @1=3 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +COMMIT
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +BEGIN
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# update t4,t5 set t4.a=4, t5.a=5 where t4.b=t5.b
>>> +# at #
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t4` mapped to number #
>>> +#server id # end_log_pos # Table_map: `test`.`t5` mapped to number #
>>> +#server id # end_log_pos # Update_rows: table id # flags: STMT_END_F
>>> +### UPDATE test.t5
>>> +### WHERE
>>> +### @1=3 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### SET
>>> +### @1=5 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +COMMIT
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +BEGIN
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# insert delayed into t3(a,b) values(1,5),(1,6),(1,7)
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t3` mapped to number #
>>> +#server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
>>> +### INSERT INTO test.t3
>>> +### SET
>>> +### @1=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=5 /* INT meta=0 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t3
>>> +### SET
>>> +### @1=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=6 /* INT meta=0 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t3
>>> +### SET
>>> +### @1=1 /* INT meta=0 nullable=1 is_null=0 */
>>> +### @2=7 /* INT meta=0 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +COMMIT
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +create table t6(a VARCHAR(60)) engine= myisam
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +BEGIN
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Rows_query
>>> +# load data infile '../../std_data/words.dat' into table t6
>>> +# at #
>>> +# at #
>>> +# at #
>>> +#server id # end_log_pos # Table_map: `test`.`t6` mapped to number #
>>> +#server id # end_log_pos # Write_rows: table id #
>>> +#server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='Aarhus' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='Aaron' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='Ababa' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='aback' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abaft' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abandon' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abandoned' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abandoning' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abandonment' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abandons' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='Aarhus' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='Aaron' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='Ababa' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='aback' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abaft' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abandon' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abandoned' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abandoning' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abandonment' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abandons' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abase' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abased' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abasement' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abasements' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abases' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abash' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abashed' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abashes' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abashing' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abasing' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abate' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abated' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abatement' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abatements' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abater' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abates' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abating' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='Abba' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abbe' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abbey' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abbeys' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abbot' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abbots' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='Abbott' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abbreviate' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abbreviated' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abbreviates' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abbreviating' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abbreviation' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abbreviations' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='Abby' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abdomen' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abdomens' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abdominal' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abduct' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abducted' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abduction' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abductions' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abductor' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abductors' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abducts' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='Abe' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='abed' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='Abel' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='Abelian' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='Abelson' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='Aberdeen' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='Abernathy' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='aberrant' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +### INSERT INTO test.t6
>>> +### SET
>>> +### @1='aberration' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +COMMIT
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +drop table t3, t6
>>> +/*!*/;
>>> +# at #
>>> +#server id # end_log_pos # Query thread_id=# exec_time=# error_code=#
>>> +SET TIMESTAMP=t/*!*/;
>>> +drop table t4, t5
>>> +/*!*/;
>>> +DELIMITER ;
>>> +# End of log file
>>> +ROLLBACK /* added by mysqlbinlog */;
>>> +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
>>> +# Test the Rows_query log event can be applied
>>> +# SHOW BINLOG EVENTS ON MASTER after '--exec MYSQL_BINLOG'
>>> +show binlog events from<binlog_start>;
>>> +Log_name Pos Event_type Server_id End_log_pos Info
>>> +master-bin.000001 # Query # # use `test`; create table t1(a int, b int)
> engine= myisam
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # insert into t1(a,b) values(1,1),(2,1)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # update t1 set a = a + 5 where b = 1
> LIMIT 1
>>> +master-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # delete from t1 where a = 6
>>> +master-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # use `test`; create table t2(a int, b int)
> engine=innodb
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # insert into t2(a,b) values(2,1),(3,1)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Rows_query # # # update t2 set a = a + 5 where b = 1
>>> +master-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Rows_query # # # delete from t2 where a = 7
>>> +master-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Xid # # COMMIT /* XID */
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # insert into t1(a,b) values(1,5)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # insert into t1(a,b) values(1,7)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Query # # COMMIT
>>> +master-bin.000001 # Query # # BEGIN
>>> +master-bin.000001 # Rows_query # # # insert into t2(a,b) values(2,5)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Rows_query # # # insert into t2(a,b) values(2,6)
>>> +master-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +master-bin.000001 # Xid # # COMMIT /* XID */
>>> +master-bin.000001 # Query # # use `test`; drop table t1, t2
>>> +# Test The Rows_query log event can be relayed.
>>> +# SHOW BINLOG EVENTS ON SLAVE
>>> +show binlog events from<binlog_start>;
>>> +Log_name Pos Event_type Server_id End_log_pos Info
>>> +slave-bin.000001 # Query # # use `test`; create table t1(a int, b int)
> engine= myisam
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # insert into t1(a,b) values(1,1),(2,1)
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Query # # COMMIT
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # update t1 set a = a + 5 where b = 1
> LIMIT 1
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +slave-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Query # # COMMIT
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # delete from t1 where a = 6
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +slave-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Query # # COMMIT
>>> +slave-bin.000001 # Query # # use `test`; create table t2(a int, b int)
> engine=innodb
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # insert into t2(a,b) values(2,1),(3,1)
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Rows_query # # # update t2 set a = a + 5 where b = 1
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +slave-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Rows_query # # # delete from t2 where a = 7
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +slave-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Xid # # COMMIT /* XID */
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # insert into t1(a,b) values(1,5)
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Query # # COMMIT
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # insert into t1(a,b) values(1,7)
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Query # # COMMIT
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # insert into t2(a,b) values(2,5)
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Rows_query # # # insert into t2(a,b) values(2,6)
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Xid # # COMMIT /* XID */
>>> +slave-bin.000001 # Query # # use `test`; drop table t1, t2
>>> +slave-bin.000001 # Query # # use `test`; create table t3(a int, b int)
> engine= myisam
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # insert into t3(a, b) values(1,1)
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t3)
>>> +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Query # # COMMIT
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # update t3,t4 set t3.a=3, t4.a=4 where
> t3.b=t4.b
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t3)
>>> +slave-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Query # # COMMIT
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # insert delayed into t3(a,b)
> values(1,5),(1,6),(1,7)
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t3)
>>> +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Query # # COMMIT
>>> +slave-bin.000001 # Query # # use `test`; create table t6(a VARCHAR(60))
> engine= myisam
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # load data infile
> '../../std_data/words.dat' into table t6
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t6)
>>> +slave-bin.000001 # Write_rows # # table_id: #
>>> +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Query # # COMMIT
>>> +slave-bin.000001 # Query # # use `test`; drop table t3, t6
>>> +slave-bin.000001 # Query # # use `test`; create table t1(a int, b int)
> engine= myisam
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # insert into t1(a,b) values(1,1),(2,1)
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Query # # COMMIT
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # update t1 set a = a + 5 where b = 1
> LIMIT 1
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +slave-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Query # # COMMIT
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # delete from t1 where a = 6
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +slave-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Query # # COMMIT
>>> +slave-bin.000001 # Query # # use `test`; create table t2(a int, b int)
> engine=innodb
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # insert into t2(a,b) values(2,1),(3,1)
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Rows_query # # # update t2 set a = a + 5 where b = 1
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +slave-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Rows_query # # # delete from t2 where a = 7
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +slave-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Xid # # COMMIT /* XID */
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # insert into t1(a,b) values(1,5)
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Query # # COMMIT
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # insert into t1(a,b) values(1,7)
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t1)
>>> +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Query # # COMMIT
>>> +slave-bin.000001 # Query # # BEGIN
>>> +slave-bin.000001 # Rows_query # # # insert into t2(a,b) values(2,5)
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Rows_query # # # insert into t2(a,b) values(2,6)
>>> +slave-bin.000001 # Table_map # # table_id: # (test.t2)
>>> +slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
>>> +slave-bin.000001 # Xid # # COMMIT /* XID */
>>> +slave-bin.000001 # Query # # use `test`; drop table t1, t2
>>>
>>> === added file 'mysql-test/suite/rpl/t/rpl_ignorable_event-master.opt'
>>> --- a/mysql-test/suite/rpl/t/rpl_ignorable_event-master.opt 1970-01-01
> 00:00:00 +0000
>>> +++ b/mysql-test/suite/rpl/t/rpl_ignorable_event-master.opt 2010-07-12
> 06:59:55 +0000
>>> @@ -0,0 +1 @@
>>> +--binlog-row-event-max-size=512 --binlog-rows-query-log-events=1
>>>
>>> === added file 'mysql-test/suite/rpl/t/rpl_ignorable_event-slave.opt'
>>> --- a/mysql-test/suite/rpl/t/rpl_ignorable_event-slave.opt 1970-01-01
> 00:00:00 +0000
>>> +++ b/mysql-test/suite/rpl/t/rpl_ignorable_event-slave.opt 2010-07-12
> 06:59:55 +0000
>>> @@ -0,0 +1 @@
>>> +--binlog-row-event-max-size=512 --binlog-rows-query-log-events=1
> --replicate-ignore-table=test.t4
>>> --replicate-wild-ignore-table=test.t5
>>>
>>> === added file 'mysql-test/suite/rpl/t/rpl_ignorable_event.test'
>>> --- a/mysql-test/suite/rpl/t/rpl_ignorable_event.test 1970-01-01 00:00:00
> +0000
>>> +++ b/mysql-test/suite/rpl/t/rpl_ignorable_event.test 2010-07-12 06:59:55
> +0000
>>> @@ -0,0 +1,90 @@
>>> +#
>>> +# WL#4033& WL#5404
>>> +# This test verifies if the query of the rows event
>>> +# is displayed with its row event as comment in RBR
>>> +# by SHOW BINLOG EVENTS and MYSQLBINLOG DUMP.
>>> +# Verifies if the Rows_query log event can be applied
>>> +# and relayed
>>> +#
>>> +
>>> +source include/have_binlog_format_row.inc;
>>> +source include/master-slave.inc;
>>> +source include/have_innodb.inc;
>>> +
>>> +--echo # Test non-transaction
>>> +let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
>>> +let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1);
>>> +create table t1(a int, b int) engine= myisam;
>>> +insert into t1(a,b) values(1,1),(2,1);
>>> +update t1 set a = a + 5 where b = 1 LIMIT 1;
>>> +delete from t1 where a = 6;
>>> +
>>> +-- echo # Test transaction
>>> +create table t2(a int, b int) engine=innodb;
>>> +begin;
>>> +insert into t2(a,b) values(2,1),(3,1);
>>> +update t2 set a = a + 5 where b = 1;
>>> +delete from t2 where a = 7;
>>> +commit;
>>> +
>>> +--echo # Test mixed transaction
>>> +begin;
>>> +insert into t1(a,b) values(1,5);
>>> +insert into t2(a,b) values(2,5);
>>> +insert into t2(a,b) values(2,6);
>>> +insert into t1(a,b) values(1,7);
>>> +commit;
>>> +
>>> +drop table t1, t2;
>>> +let $end_pos= query_get_value("SHOW MASTER STATUS", Position, 1);
>>> +
>>> +create table t3(a int, b int) engine= myisam;
>>> +create table t4(a int, b int) engine= myisam;
>>> +create table t5(a int, b int) engine= myisam;
>>> +insert into t3(a, b) values(1,1);
>>> +--echo # Test the Rows_query log event will be filtered out if slave applys
>>> +--echo # '--replicate-ignore-table' option on the table
>>> +insert into t4(a, b) values(2,1);
>>> +--echo # Test the Rows_query log event will be relayed if slave
>>> +--echo # filters out part Rows event from a rows statement
>>> +update t3,t4 set t3.a=3, t4.a=4 where t3.b=t4.b;
>>> +
>>> +--echo # Test the Rows_query log event will be filtered out if slave applys
>>> +--echo # '--replicate-wild-ignore-table' option on the table
>>> +insert into t5(a, b) values(3,1);
>>> +--echo # Test the Rows_query log event will be filtered out if slave
> filters
>>> +--echo # out all its related tables by replication filtering rules
>>> +update t4,t5 set t4.a=4, t5.a=5 where t4.b=t5.b;
>>> +
>>> +--echo # Test insert delayed ...
>>> +insert delayed into t3(a,b) values(1,5),(1,6),(1,7);
>>> +
>>> +--echo # Test load data infile
>>> +create table t6(a VARCHAR(60)) engine= myisam;
>>> +load data infile '../../std_data/words.dat' into table t6;
>>> +
>>> +drop table t3, t6;
>>> +drop table t4, t5;
>>> +
>>> +--echo # SHOW BINLOG EVENTS ON MASTER before '--exec MYSQL_BINLOG'
>>> +source include/show_binlog_events.inc;
>>> +
>>> +--echo # MYSQL_BINLOG output base on master-bin.000001
>>> +let $MYSQLD_DATADIR= `select @@datadir`;
>>> +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
>>> +--replace_regex /TIMESTAMP=[0-9]*/TIMESTAMP=t/ /#[0-9]*[
> ]*[0-9]*:[0-9]*:[0-9]* server id [0-9]*/#server id #/
>>> /exec_time=[0-9]*/exec_time=#/ /error_code=[0-9]*/error_code=#/ /end_log_pos
> [0-9]*/end_log_pos #/ /# at [0-9]*/# at
>>> #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id
> [0-9]*/table id #/ /mapped to number [0-9]*/mapped
>>> to number #/ /server v [^ ]*/server v #.##.##/ /Start: binlog v [0-9]*/Start:
> binlog v#/ /created [0-9]*[
>>> ]*[0-9]*:[0-9]*:[0-9]* at startup/created # #:#:# at startup/
>>> +--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v
> $MYSQLD_DATADIR/$master_binlog
>>> +
>>> +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
>>> +--echo # Test the Rows_query log event can be applied
>>> +--exec $MYSQL_BINLOG -v -v --stop-position=$end_pos
> $MYSQLD_DATADIR/$master_binlog | $MYSQL test 2>&1
>>> +
>>> +--echo # SHOW BINLOG EVENTS ON MASTER after '--exec MYSQL_BINLOG'
>>> +source include/show_binlog_events.inc;
>>> +
>>> +sync_slave_with_master;
>>> +--let $binlog_start= query_get_value(SHOW BINLOG EVENTS LIMIT 1,
> End_log_pos, 1)
>>> +--echo # Test The Rows_query log event can be relayed.
>>> +--echo # SHOW BINLOG EVENTS ON SLAVE
>>> +source include/show_binlog_events.inc;
>>> +
>>>
>>> === modified file 'sql/log_event.cc'
>>> --- a/sql/log_event.cc 2010-07-07 06:48:50 +0000
>>> +++ b/sql/log_event.cc 2010-07-12 06:59:55 +0000
>>> @@ -126,6 +126,49 @@ static const char *HA_ERR(int i)
>>> }
>>>
>>> /**
>>> + Delete the log event after it has been executed
>>> +
>>> + @param ev log event should be deleted
>>> + @param rli Relay_log_info structure for the slave IO thread.
>>> +*/
>>> +void delete_log_event(Log_event *ev, Relay_log_info *rli)
>>> +{
>>> + DBUG_ENTER("delete_log_event");
>>> + Log_event_type ev_type= ev->get_type_code();
>>> +
>>> + /*
>>> + Format_description_log_event should not be deleted because it will be
>>> + used to read info about the relay log's format; it will be deleted when
>>> + the SQL thread does not need it, i.e. when this thread terminates.
>>> + */
>>> + if (ev_type != FORMAT_DESCRIPTION_EVENT)
>>> + {
>>> + /* Delete the Rows_query log event after its last rows event are applied
> */
>>> + if ((ev_type == WRITE_ROWS_EVENT || ev_type == DELETE_ROWS_EVENT ||
>>> + ev_type == UPDATE_ROWS_EVENT)&& rli->rows_query_ev !=
> NULL&&
>>> + ((Rows_log_event*) ev)->get_flags(Rows_log_event::STMT_END_F))
>>> + {
>>> + delete rli->rows_query_ev;
>>> + rli->rows_query_ev= NULL;
>>> + }
>>> +
>>> + /* Record the Rows_query log event until all its rows event are applied */
>>> + if (ev_type == ROWS_QUERY_LOG_EVENT)
>>> + {
>>> + DBUG_ASSERT(rli->rows_query_ev == NULL);
>>> + rli->rows_query_ev= (Rows_query_log_event*) ev;
>>> + }
>>> + else
>>> + {
>>> + DBUG_PRINT("info", ("Deleting the event after it has been executed"));
>>> + delete ev;
>>> + ev= NULL;
>>> + }
>>> + }
>>> + DBUG_VOID_RETURN;
>>> +}
>>> +
>>> +/**
>>> Error reporting facility for Rows_log_event::do_apply_event
>>>
>>> @param level error, warning or info
>>> @@ -9750,8 +9793,14 @@ Rows_query_log_event::~Rows_query_log_ev
>>> #ifndef MYSQL_CLIENT
>>> void Rows_query_log_event::pack_info(Protocol *protocol)
>>> {
>>> - protocol->store(m_rows_query, (uint) strlen(m_rows_query),
>>> -&my_charset_bin);
>>> + char *buf;
>>> + size_t bytes;
>>> + ulong len= sizeof("# ") + (ulong) strlen(m_rows_query) + 1;
>>> + if (!(buf= (char*) my_malloc(len, MYF(MY_WME))))
>>> + return;
>>> + bytes= my_snprintf(buf, len, "# %s", m_rows_query);
>>> + protocol->store(buf, bytes,&my_charset_bin);
>>> + my_free(buf, MYF(MY_ALLOW_ZERO_PTR));
>>> }
>>> #endif
>>>
>>> @@ -9766,7 +9815,7 @@ Rows_query_log_event::print(FILE *file,
>>> Write_on_release_cache cache(&print_event_info->head_cache, file);
>>> print_header(&cache, print_event_info, FALSE);
>>> my_b_printf(&cache, "\tRows_query\n");
>>> - my_b_printf(&cache, "%s\n", m_rows_query);
>>> + my_b_printf(&cache, "# %s\n", m_rows_query);
>>>
>>> IO_CACHE *const body=&print_event_info->body_cache;
>>> print_base64(body, print_event_info, true);
>>> @@ -9780,6 +9829,17 @@ Rows_query_log_event::write_data_body(IO
>>> DBUG_RETURN(write_str(file, m_rows_query, (uint) strlen(m_rows_query)));
>>> }
>>>
>>> +#ifndef MYSQL_CLIENT
>>> +int Rows_query_log_event::do_apply_event(Relay_log_info const *rli)
>>> +{
>>> + DBUG_ENTER("Rows_query_log_event::do_apply_event");
>>> + DBUG_ASSERT(rli->sql_thd == thd);
>>> + /* Set query for writing Rows_query log event into binlog later.*/
>>> + thd->set_query(m_rows_query, (uint32) strlen(m_rows_query));
>>> + DBUG_RETURN(0);
>>> +}
>>> +#endif /* !MYSQL_CLIENT */
>>> +
>>>
>>> #ifdef MYSQL_CLIENT
>>> /**
>>>
>>> === modified file 'sql/log_event.h'
>>> --- a/sql/log_event.h 2010-07-07 06:48:50 +0000
>>> +++ b/sql/log_event.h 2010-07-12 06:59:55 +0000
>>> @@ -4105,10 +4105,9 @@ public:
>>> : Ignorable_log_event(thd_arg)
>>> {
>>> DBUG_ENTER("Rows_query_log_event::Rows_query_log_event");
>>> - ulong len= sizeof("# ") + query_len + 1;
>>> - if (!(m_rows_query= (char*) my_malloc(len, MYF(MY_WME))))
>>> + if (!(m_rows_query= (char*) my_malloc(query_len + 1, MYF(MY_WME))))
>>> return;
>>> - my_snprintf(m_rows_query, len, "# %s", query);
>>> + my_snprintf(m_rows_query, query_len + 1, "%s", query);
>>> DBUG_PRINT("enter", ("%s", m_rows_query));
>>> DBUG_VOID_RETURN;
>>> }
>>> @@ -4136,6 +4135,9 @@ public:
>>> }
>>>
>>> private:
>>> +#if !defined(MYSQL_CLIENT)
>>> + virtual int do_apply_event(Relay_log_info const* rli);
>>> +#endif
>>>
>>> char * m_rows_query;
>>> };
>>> @@ -4189,6 +4191,7 @@ private:
>>> int append_query_string(CHARSET_INFO *csinfo,
>>> String const *from, String *to);
>>> bool sqlcom_can_generate_row_events(const THD *thd);
>>> +void delete_log_event(Log_event *ev, Relay_log_info *rli);
>>>
>>> /**
>>> @} (end of group Replication)
>>>
>>> === modified file 'sql/rpl_rli.cc'
>>> --- a/sql/rpl_rli.cc 2010-06-22 12:58:10 +0000
>>> +++ b/sql/rpl_rli.cc 2010-07-12 06:59:55 +0000
>>> @@ -47,7 +47,7 @@ Relay_log_info::Relay_log_info(bool is_s
>>> tables_to_lock(0), tables_to_lock_count(0),
>>> last_event_start_time(0),
>>> sql_delay(0), sql_delay_end(0),
>>> - m_flags(0)
>>> + m_flags(0), rows_query_ev(NULL)
>>> {
>>> DBUG_ENTER("Relay_log_info::Relay_log_info");
>>>
>>>
>>> === modified file 'sql/rpl_rli.h'
>>> --- a/sql/rpl_rli.h 2010-06-22 12:58:10 +0000
>>> +++ b/sql/rpl_rli.h 2010-07-12 06:59:55 +0000
>>> @@ -357,6 +357,8 @@ public:
>>> RPL_TABLE_LIST *tables_to_lock; /* RBR: Tables to lock */
>>> uint tables_to_lock_count; /* RBR: Count of tables to lock */
>>> table_mapping m_table_map; /* RBR: Mapping table-id to table */
>>> + /* RBR: Record Rows_query log event */
>>> + Rows_query_log_event* rows_query_ev;
>>>
>>> bool get_table_data(TABLE *table_arg, table_def **tabledef_var, TABLE
> **conv_table_var) const
>>> {
>>>
>>> === modified file 'sql/rpl_slave.cc'
>>> --- a/sql/rpl_slave.cc 2010-06-23 09:56:24 +0000
>>> +++ b/sql/rpl_slave.cc 2010-07-12 06:59:55 +0000
>>> @@ -2733,16 +2733,7 @@ static int exec_relay_log_event(THD* thd
>>>
>>> exec_res= apply_event_and_update_pos(ev, thd, rli);
>>>
>>> - /*
>>> - Format_description_log_event should not be deleted because it will be
>>> - used to read info about the relay log's format; it will be deleted when
>>> - the SQL thread does not need it, i.e. when this thread terminates.
>>> - */
>>> - if (ev->get_type_code() != FORMAT_DESCRIPTION_EVENT)
>>> - {
>>> - DBUG_PRINT("info", ("Deleting the event after it has been executed"));
>>> - delete ev;
>>> - }
>>> + delete_log_event(ev, rli);
>>>
>>> /*
>>> update_log_pos failed: this should not happen, so we don't
>>>
>>> === modified file 'sql/sql_binlog.cc'
>>> --- a/sql/sql_binlog.cc 2010-06-22 12:58:10 +0000
>>> +++ b/sql/sql_binlog.cc 2010-07-12 06:59:55 +0000
>>> @@ -75,7 +75,8 @@ static int check_event_type(int type, Re
>>>
>>> /* It is always allowed to execute FD events. */
>>> return 0;
>>> -
>>> +
>>> + case ROWS_QUERY_LOG_EVENT:
>>> case TABLE_MAP_EVENT:
>>> case WRITE_ROWS_EVENT:
>>> case UPDATE_ROWS_EVENT:
>>> @@ -273,15 +274,9 @@ void mysql_client_binlog_statement(THD*
>>> #else
>>> err= 0;
>>> #endif
>>> - /*
>>> - Format_description_log_event should not be deleted because it
>>> - will be used to read info about the relay log's format; it
>>> - will be deleted when the SQL thread does not need it,
>>> - i.e. when this thread terminates.
>>> - */
>>> - if (ev->get_type_code() != FORMAT_DESCRIPTION_EVENT)
>>> - delete ev;
>>> - ev= 0;
>>> +
>>> + delete_log_event(ev, rli);
>>> +
>>> if (err)
>>> {
>>> /*
>>>
>>>
>>>
>>>
>>>
>>
>
>

Thread
bzr commit into mysql-next-mr branch (Dao-Gang.Qu:3166) WL#5404Dao-Gang.Qu12 Jul
  • Re: bzr commit into mysql-next-mr branch (Dao-Gang.Qu:3166) WL#5404He Zhenxing12 Jul
  • Re: bzr commit into mysql-next-mr branch (Dao-Gang.Qu:3166) WL#5404Luís Soares12 Jul
    • Re: bzr commit into mysql-next-mr branch (Dao-Gang.Qu:3166) WL#5404Daogang Qu13 Jul
      • Re: bzr commit into mysql-next-mr branch (Dao-Gang.Qu:3166) WL#5404Luís Soares13 Jul
        • Re: bzr commit into mysql-next-mr branch (Dao-Gang.Qu:3166) WL#5404Daogang Qu14 Jul
          • Re: bzr commit into mysql-next-mr branch (Dao-Gang.Qu:3166) WL#5404Luís Soares14 Jul