List:Commits« Previous MessageNext Message »
From:Sven Sandberg Date:October 27 2010 3:56pm
Subject:Re: bzr commit into mysql-next-mr-bugfixing branch (Dao-Gang.Qu:3324)
Bug#55790
View as plain text  
Hi Dao-Gang,

Thank you for this patch, great work! I think there are two small 
mistake, so I reject the patch.

  - Mistake in mysqlbinlog.cc, process_event(), case 
ROWS_QUERY_LOG_EVENT. See comment inline.

  - Slightly misleading error message (my mistake), see comment inline.

/Sven


On 10/27/2010 08:22 AM, Dao-Gang.Qu@stripped wrote:
> #At file:///home/daogangqu/mysql/bzrwork1/bug55790/mysql-next-mr-bugfixing/ based on
> revid:dao-gang.qu@stripped
>
>   3324 Dao-Gang.Qu@stripped	2010-10-27
>        Bug #55790  	Read_Master_Log_Pos is wrong after Slave_IO_Error=
> ER_NET_PACKET_TOO_LARGE
>
>        When logging in row format, DML is written as a Table_map_event
>        followed by its row events. The Table_map_event is written to
>        the relay log by slave I/O thread even if its rows events are
>        discarded. But it is not displayed by MYSQLBINLOG. However,
>        the Read_Master_Log_Pos displayed by SHOW SLAVE STATUS is
>        at the end of the Table_map_Log_event.
>
>        After the patch, the header of the Table_map_log_event will
>        be displayed by MYSQLBINLOG so long as it was written to
>        the relay log even if its rows events are discarded. To
>        multi rows events in one statement, the headers of other
>        rows events also will be displayed if the last rows event
>        is discarded by slave I/O thread. And MYSQLBINLOG will print
>        a warning for the missed rows event.
>        Refactoring:
>        Mysqlbinlog prints 'at' to head cache. Log_event prints head
>        to the head cache and body to the body cache. Mysqlbinlog
>        flushes the head and body caches if needed.
>       @ client/mysqlbinlog.cc
>          Add code to flush the head and body caches if needed,
>          and print a warning if the body cache is nonempty
>          after a binlog has been processed.
>       @ mysql-test/suite/rpl/r/rpl_packet.result
>          Test result for Bug #55790
>       @ mysql-test/suite/rpl/r/rpl_row_ignorable_event.result
>          Updated for the patch of Bug #55790
>       @ mysql-test/suite/rpl/t/rpl_packet.test
>          Added test to verify if the header Table_map_log_even will
>          be displayed by MYSQLBINLOG so long as it was written to
>          the relay log, even if its rows events are discarded. And
>          MYSQLBINLOG will print a warning for the missed rows event.
>       @ sql/log_event.cc
>          Updated code to get rid of Write_on_release_cache and
>          do not flush the head and body cache here.
>       @ sql/log_event_old.cc
>          Remove code for not flushing the head and body cache here.
>
>      modified:
>        client/mysqlbinlog.cc
>        mysql-test/suite/rpl/r/rpl_packet.result
>        mysql-test/suite/rpl/r/rpl_row_ignorable_event.result
>        mysql-test/suite/rpl/t/rpl_packet.test
>        sql/log_event.cc
>        sql/log_event_old.cc
> === modified file 'client/mysqlbinlog.cc'
> --- a/client/mysqlbinlog.cc	2010-09-01 02:51:08 +0000
> +++ b/client/mysqlbinlog.cc	2010-10-27 06:22:33 +0000
> @@ -35,6 +35,7 @@
>   #include<signal.h>
>   #include<my_dir.h>
>   #include "log_event.h"
> +#include "log_event_old.h"
>   #include "sql_common.h"
>
>   #define BIN_LOG_HEADER_SIZE	4
> @@ -728,7 +729,8 @@ Exit_status process_event(PRINT_EVENT_IN
>         goto end;
>       }
>       if (!short_form)
> -      fprintf(result_file, "# at %s\n",llstr(pos,ll_buff));
> +      my_b_printf(&print_event_info->head_cache,
> +                  "# at %s\n",llstr(pos,ll_buff));
>
>       if (!opt_hexdump)
>         print_event_info->hexdump_from= 0; /* Disabled */
> @@ -896,9 +898,6 @@ Exit_status process_event(PRINT_EVENT_IN
>         break;
>       }
>       case ROWS_QUERY_LOG_EVENT:
> -      if (verbose>= 2)
> -        ev->print(result_file, print_event_info);
> -      break;
>       case TABLE_MAP_EVENT:

It's good that you moved the check for verbose to log_event.cc, but I 
think there's a typo here, it has to call ev->print, and the 'break' 
statement should not be removed. I think it should be something like:

      case ROWS_QUERY_LOG_EVENT:
-      if (verbose>= 2)
-        ev->print(result_file, print_event_info);
+      ev->print(result_file, print_event_info);
        break;

>       {
>         Table_map_log_event *map= ((Table_map_log_event *)ev);
> @@ -916,7 +915,7 @@ Exit_status process_event(PRINT_EVENT_IN
>       case PRE_GA_DELETE_ROWS_EVENT:
>       case PRE_GA_UPDATE_ROWS_EVENT:
>       {
> -      if (ev_type != TABLE_MAP_EVENT)
> +      if (ev_type != TABLE_MAP_EVENT&&  ev_type != ROWS_QUERY_LOG_EVENT)
>         {
>           Rows_log_event *e= (Rows_log_event*) ev;
>           Table_map_log_event *ignored_map=
> @@ -979,11 +978,42 @@ Exit_status process_event(PRINT_EVENT_IN
>                   type_str);
>           goto err;
>         }
> -      /* FALL THROUGH */
> +
> +      ev->print(result_file, print_event_info);
> +      bool stmt_end= FALSE;
> +      if (ev_type == WRITE_ROWS_EVENT ||
> +          ev_type == DELETE_ROWS_EVENT ||
> +          ev_type == UPDATE_ROWS_EVENT)
> +      {
> +        Rows_log_event *new_ev= (Rows_log_event*) ev;
> +        if (new_ev->get_flags(Rows_log_event::STMT_END_F))
> +          stmt_end= TRUE;
> +      }
> +      else if (ev_type == PRE_GA_WRITE_ROWS_EVENT ||
> +               ev_type == PRE_GA_DELETE_ROWS_EVENT ||
> +               ev_type == PRE_GA_UPDATE_ROWS_EVENT)
> +      {
> +        Old_rows_log_event *old_ev= (Old_rows_log_event*) ev;
> +        if (old_ev->get_flags(Rows_log_event::STMT_END_F))
> +          stmt_end= TRUE;
> +      }
> +      /* Flush head and body cache to result_file */
> +      if (stmt_end)
> +      {
> +        if
> (copy_event_cache_to_file_and_reinit(&print_event_info->head_cache, result_file)
> ||
> +           
> copy_event_cache_to_file_and_reinit(&print_event_info->body_cache, result_file))
> +          goto err;
> +        goto end;
> +      }
> +      break;
>       }
>       default:
>         ev->print(result_file, print_event_info);
>       }
> +    /* Flush head cache to result_file for every event */
> +    if (copy_event_cache_to_file_and_reinit(&print_event_info->head_cache,
> +                                            result_file))
> +      goto err;
>     }
>
>     goto end;
> @@ -1469,6 +1499,15 @@ static Exit_status dump_log_entries(cons
>     rc= (remote_opt ? dump_remote_log_entries(&print_event_info, logname) :
>          dump_local_log_entries(&print_event_info, logname));
>
> +  if (my_b_tell(&print_event_info.body_cache))
> +    warning("The range of printed events ends with a row event or "
> +            "a table map event that does not have the STMT_END_F "
> +            "flag set. This might be because the last statement "
> +            "was not fully written to the log, or because you are "
> +            "using a --stop-position or --stop-datetime that refers "
> +            "to an event in the middle of a statement. The partial "
> +            "event has not been written to output.");

I know I suggested this formulation, but I think I made a mistake. 
"partial event" is a bit misleading because the event is not partial, 
it's the statement that is partial. So I would suggest to change the 
last sentence to "The event(s) from the partial statement have not been 
written to output."

> +
>     /* Set delimiter back to semicolon */
>     if (!raw_mode)
>     {
>
> === modified file 'mysql-test/suite/rpl/r/rpl_packet.result'
> --- a/mysql-test/suite/rpl/r/rpl_packet.result	2010-07-20 15:27:13 +0000
> +++ b/mysql-test/suite/rpl/r/rpl_packet.result	2010-10-27 06:22:33 +0000
> @@ -57,6 +57,30 @@ SHOW BINLOG EVENTS;
>   SET @max_allowed_packet_1= @@session.max_allowed_packet;
>   SHOW BINLOG EVENTS;
>   SET @max_allowed_packet_2= @@session.max_allowed_packet;
> +START SLAVE;
> +DROP TABLE t1;
> +select @@global.max_allowed_packet;
> +@@global.max_allowed_packet
> +4096
> +select @@global.net_buffer_length;
> +@@global.net_buffer_length
> +4096
> +select @@global.max_allowed_packet;
> +@@global.max_allowed_packet
> +1024
> +select @@global.net_buffer_length;
> +@@global.net_buffer_length
> +1024
> +CREATE TABLE t1 (a TEXT) ENGINE=MyISAM;
> +INSERT INTO t1 VALUES (REPEAT('a', 2048));
> +# 1153 = ER_NET_PACKET_TOO_LARGE
> +Last_IO_Error = Got a packet bigger than 'max_allowed_packet' bytes
> +# Now Read_Master_Log_Pos is as following:
> +Read_Master_Log_Pos	424
> +# Test the Table_map_log_event is displayed at Read_Master_Log_Pos by MYSQLBINLOG
> +Last event in relay log:
> +#server id #  end_log_pos 424 	Table_map: `test`.`t1` mapped to number #
> +WARNING: The range of printed events ends with a row event or a table map event that
> does not have the STMT_END_F flag set. This might be because the last statement was not
> fully written to the log, or because you are using a --stop-position or --stop-datetime
> that refers to an event in the middle of a statement. The partial event has not been
> written to output.
>   ==== clean up ====
>   DROP TABLE t1;
>   SET @@global.max_allowed_packet= 1024;
>
> === modified file 'mysql-test/suite/rpl/r/rpl_row_ignorable_event.result'
> --- a/mysql-test/suite/rpl/r/rpl_row_ignorable_event.result	2010-09-01 02:51:08
> +0000
> +++ b/mysql-test/suite/rpl/r/rpl_row_ignorable_event.result	2010-10-27 06:22:33
> +0000
> @@ -173,8 +173,8 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Write_rows: table id # flags: STMT_END_F
>   ### INSERT INTO test.t1
>   ### SET
> @@ -198,8 +198,8 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Update_rows: table id # flags: STMT_END_F
>   ### UPDATE test.t1
>   ### WHERE
> @@ -222,8 +222,8 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Delete_rows: table id # flags: STMT_END_F
>   ### DELETE FROM test.t1
>   ### WHERE
> @@ -248,8 +248,8 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Write_rows: table id # flags: STMT_END_F
>   ### INSERT INTO test.t2
>   ### SET
> @@ -263,8 +263,8 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Update_rows: table id # flags: STMT_END_F
>   ### UPDATE test.t2
>   ### WHERE
> @@ -284,8 +284,8 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Delete_rows: table id # flags: STMT_END_F
>   ### DELETE FROM test.t2
>   ### WHERE
> @@ -303,8 +303,8 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Write_rows: table id # flags: STMT_END_F
>   ### INSERT INTO test.t1
>   ### SET
> @@ -324,8 +324,8 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Write_rows: table id # flags: STMT_END_F
>   ### INSERT INTO test.t1
>   ### SET
> @@ -345,8 +345,8 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Write_rows: table id # flags: STMT_END_F
>   ### INSERT INTO test.t2
>   ### SET
> @@ -356,8 +356,8 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Write_rows: table id # flags: STMT_END_F
>   ### INSERT INTO test.t2
>   ### SET
> @@ -395,8 +395,8 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Write_rows: table id # flags: STMT_END_F
>   ### INSERT INTO test.t3
>   ### SET
> @@ -416,8 +416,8 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Write_rows: table id # flags: STMT_END_F
>   ### INSERT INTO test.t4
>   ### SET
> @@ -437,12 +437,12 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Table_map: `test`.`t4` mapped to number #
> +# at #
>   #server id #  end_log_pos # 	Update_rows: table id #
> +# at #
>   #server id #  end_log_pos # 	Update_rows: table id # flags: STMT_END_F
>   ### UPDATE test.t3
>   ### WHERE
> @@ -472,8 +472,8 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Write_rows: table id # flags: STMT_END_F
>   ### INSERT INTO test.t5
>   ### SET
> @@ -493,10 +493,10 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Table_map: `test`.`t5` mapped to number #
> +# at #
>   #server id #  end_log_pos # 	Update_rows: table id # flags: STMT_END_F
>   ### UPDATE test.t5
>   ### WHERE
> @@ -519,8 +519,8 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Write_rows: table id # flags: STMT_END_F
>   ### INSERT INTO test.t3
>   ### SET
> @@ -553,10 +553,10 @@ BEGIN
>   #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 #
> +# at #
>   #server id #  end_log_pos # 	Write_rows: table id #
> +# at #
>   #server id #  end_log_pos # 	Write_rows: table id # flags: STMT_END_F
>   ### INSERT INTO test.t6
>   ### SET
>
> === modified file 'mysql-test/suite/rpl/t/rpl_packet.test'
> --- a/mysql-test/suite/rpl/t/rpl_packet.test	2010-08-06 08:54:01 +0000
> +++ b/mysql-test/suite/rpl/t/rpl_packet.test	2010-10-27 06:22:33 +0000
> @@ -152,6 +152,57 @@ if (`SELECT NOT(@max_allowed_packet_0 =
>     --die @max_allowed_packet changed after executing SHOW BINLOG EVENTS
>   }
>
> +#
> +# BUG#55790
> +# This test verifies if the header of Table_map_log_event
> +# will be displayed by MYSQLBINLOG so long as it was written
> +# to the relay log, even if its rows events are discarded.
> +# And MYSQLBINLOG will print a warning for the missed
> +# rows event.
> +#
> +
> +connection slave;
> +START SLAVE;
> +--source include/wait_for_slave_to_start.inc
> +
> +connection master;
> +DROP TABLE t1;
> +select @@global.max_allowed_packet;
> +select @@global.net_buffer_length;
> +sync_slave_with_master;
> +select @@global.max_allowed_packet;
> +select @@global.net_buffer_length;
> +
> +--connection master
> +CREATE TABLE t1 (a TEXT) ENGINE=MyISAM;
> +--sync_slave_with_master
> +
> +# Create big row event.
> +--connection master
> +INSERT INTO t1 VALUES (REPEAT('a', 2048));
> +
> +# Slave IO thread should stop with error when trying to read the big event.
> +--connection slave
> +--echo # 1153 = ER_NET_PACKET_TOO_LARGE
> +--let $slave_io_errno= 1153
> +--let $show_slave_io_error= 1
> +--source include/wait_for_slave_io_error.inc
> +
> +--echo # Now Read_Master_Log_Pos is as following:
> +--let $status_items= Read_Master_Log_Pos
> +--source include/show_slave_status.inc
> +
> +--echo # Test the Table_map_log_event is displayed at Read_Master_Log_Pos by
> MYSQLBINLOG
> +--let $MYSQLD_DATADIR= `SELECT @@datadir`
> +--let $MYSQLD_TMPDIR= `select @@tmpdir`
> +--echo Last event in relay log:
> +--let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
> +--replace_regex /#[0-9]*[ ]*[0-9]*:[0-9]*:[0-9]* server id [0-9]*/#server id #/
> /mapped to number [0-9]*/mapped to number #/
> +exec $MYSQL_BINLOG $MYSQLD_DATADIR/$binlog_file 2>  $MYSQLD_TMPDIR/warning.txt
> + | grep 'end_log_pos'
> + | tail -n 1;
> +--cat_file $MYSQLD_TMPDIR/warning.txt
> +--remove_file $MYSQLD_TMPDIR/warning.txt
>
>   --echo ==== clean up ====
>   connection master;
>
> === modified file 'sql/log_event.cc'
> --- a/sql/log_event.cc	2010-09-24 15:24:54 +0000
> +++ b/sql/log_event.cc	2010-10-27 06:22:33 +0000
> @@ -201,83 +201,6 @@ static void inline slave_rows_error_repo
>   }
>   #endif
>
> -/*
> -  Cache that will automatically be written to a dedicated file on
> -  destruction.
> -
> -  DESCRIPTION
> -
> - */
> -class Write_on_release_cache
> -{
> -public:
> -  enum flag
> -  {
> -    FLUSH_F
> -  };
> -
> -  typedef unsigned short flag_set;
> -
> -  /*
> -    Constructor.
> -
> -    SYNOPSIS
> -      Write_on_release_cache
> -      cache  Pointer to cache to use
> -      file   File to write cache to upon destruction
> -      flags  Flags for the cache
> -
> -    DESCRIPTION
> -
> -      Class used to guarantee copy of cache to file before exiting the
> -      current block.  On successful copy of the cache, the cache will
> -      be reinited as a WRITE_CACHE.
> -
> -      Currently, a pointer to the cache is provided in the
> -      constructor, but it would be possible to create a subclass
> -      holding the IO_CACHE itself.
> -   */
> -  Write_on_release_cache(IO_CACHE *cache, FILE *file, flag_set flags = 0)
> -    : m_cache(cache), m_file(file), m_flags(flags)
> -  {
> -    reinit_io_cache(m_cache, WRITE_CACHE, 0L, FALSE, TRUE);
> -  }
> -
> -  ~Write_on_release_cache()
> -  {
> -    copy_event_cache_to_file_and_reinit(m_cache, m_file);
> -    if (m_flags | FLUSH_F)
> -      fflush(m_file);
> -  }
> -
> -  /*
> -    Return a pointer to the internal IO_CACHE.
> -
> -    SYNOPSIS
> -      operator&()
> -
> -    DESCRIPTION
> -
> -      Function to return a pointer to the internal cache, so that the
> -      object can be treated as a IO_CACHE and used with the my_b_*
> -      IO_CACHE functions
> -
> -    RETURN VALUE
> -      A pointer to the internal IO_CACHE.
> -   */
> -  IO_CACHE *operator&()
> -  {
> -    return m_cache;
> -  }
> -
> -private:
> -  // Hidden, to prevent usage.
> -  Write_on_release_cache(Write_on_release_cache const&);
> -
> -  IO_CACHE *m_cache;
> -  FILE *m_file;
> -  flag_set m_flags;
> -};
>
>   /*
>     pretty_print_str()
> @@ -3143,11 +3066,11 @@ void Query_log_event::print_query_header
>
>   void Query_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
>   {
> -  Write_on_release_cache cache(&print_event_info->head_cache, file);
> +  IO_CACHE *const head=&print_event_info->head_cache;
>
> -  print_query_header(&cache, print_event_info);
> -  my_b_write(&cache, (uchar*) query, q_len);
> -  my_b_printf(&cache, "\n%s\n", print_event_info->delimiter);
> +  print_query_header(head, print_event_info);
> +  my_b_write(head, (uchar*) query, q_len);
> +  my_b_printf(head, "\n%s\n", print_event_info->delimiter);
>   }
>   #endif /* MYSQL_CLIENT */
>
> @@ -3639,20 +3562,19 @@ void Start_log_event_v3::print(FILE* fil
>   {
>     DBUG_ENTER("Start_log_event_v3::print");
>
> -  Write_on_release_cache cache(&print_event_info->head_cache, file,
> -                               Write_on_release_cache::FLUSH_F);
> +  IO_CACHE *const head=&print_event_info->head_cache;
>
>     if (!print_event_info->short_form)
>     {
> -    print_header(&cache, print_event_info, FALSE);
> -    my_b_printf(&cache, "\tStart: binlog v %d, server v %s created ",
> +    print_header(head, print_event_info, FALSE);
> +    my_b_printf(head, "\tStart: binlog v %d, server v %s created ",
>                   binlog_version, server_version);
> -    print_timestamp(&cache);
> +    print_timestamp(head);
>       if (created)
> -      my_b_printf(&cache," at startup");
> -    my_b_printf(&cache, "\n");
> +      my_b_printf(head," at startup");
> +    my_b_printf(head, "\n");
>       if (flags&  LOG_EVENT_BINLOG_IN_USE_F)
> -      my_b_printf(&cache, "# Warning: this binlog is either in use or was not "
> +      my_b_printf(head, "# Warning: this binlog is either in use or was not "
>                     "closed properly.\n");
>     }
>     if (!is_artificial_event()&&  created)
> @@ -3664,9 +3586,9 @@ void Start_log_event_v3::print(FILE* fil
>         and rollback unfinished transaction.
>         Probably this can be done with RESET CONNECTION (syntax to be defined).
>       */
> -    my_b_printf(&cache,"RESET CONNECTION%s\n", print_event_info->delimiter);
> +    my_b_printf(head,"RESET CONNECTION%s\n", print_event_info->delimiter);
>   #else
> -    my_b_printf(&cache,"ROLLBACK%s\n", print_event_info->delimiter);
> +    my_b_printf(head,"ROLLBACK%s\n", print_event_info->delimiter);
>   #endif
>     }
>     if (temp_buf&&
> @@ -3674,8 +3596,8 @@ void Start_log_event_v3::print(FILE* fil
>         !print_event_info->short_form)
>     {
>       if (print_event_info->base64_output_mode != BASE64_OUTPUT_DECODE_ROWS)
> -      my_b_printf(&cache, "BINLOG '\n");
> -    print_base64(&cache, print_event_info, FALSE);
> +      my_b_printf(head, "BINLOG '\n");
> +    print_base64(head, print_event_info, FALSE);
>       print_event_info->printed_fd_event= TRUE;
>     }
>     DBUG_VOID_RETURN;
> @@ -4624,13 +4546,13 @@ void Load_log_event::print(FILE* file, P
>   void Load_log_event::print(FILE* file_arg, PRINT_EVENT_INFO* print_event_info,
>   			   bool commented)
>   {
> -  Write_on_release_cache cache(&print_event_info->head_cache, file_arg);
> +  IO_CACHE *const head=&print_event_info->head_cache;
>
>     DBUG_ENTER("Load_log_event::print");
>     if (!print_event_info->short_form)
>     {
> -    print_header(&cache, print_event_info, FALSE);
> -    my_b_printf(&cache, "\tQuery\tthread_id=%ld\texec_time=%ld\n",
> +    print_header(head, print_event_info, FALSE);
> +    my_b_printf(head, "\tQuery\tthread_id=%ld\texec_time=%ld\n",
>                   thread_id, exec_time);
>     }
>
> @@ -4649,66 +4571,66 @@ void Load_log_event::print(FILE* file_ar
>     }
>
>     if (db&&  db[0]&&  different_db)
> -    my_b_printf(&cache, "%suse %s%s\n",
> +    my_b_printf(head, "%suse %s%s\n",
>               commented ? "# " : "",
>               db, print_event_info->delimiter);
>
>     if (flags&  LOG_EVENT_THREAD_SPECIFIC_F)
> -    my_b_printf(&cache,"%sSET @@session.pseudo_thread_id=%lu%s\n",
> +    my_b_printf(head,"%sSET @@session.pseudo_thread_id=%lu%s\n",
>               commented ? "# " : "", (ulong)thread_id,
>               print_event_info->delimiter);
> -  my_b_printf(&cache, "%sLOAD DATA ",
> +  my_b_printf(head, "%sLOAD DATA ",
>                 commented ? "# " : "");
>     if (check_fname_outside_temp_buf())
> -    my_b_printf(&cache, "LOCAL ");
> -  my_b_printf(&cache, "INFILE '%-*s' ", fname_len, fname);
> +    my_b_printf(head, "LOCAL ");
> +  my_b_printf(head, "INFILE '%-*s' ", fname_len, fname);
>
>     if (sql_ex.opt_flags&  REPLACE_FLAG)
> -    my_b_printf(&cache,"REPLACE ");
> +    my_b_printf(head,"REPLACE ");
>     else if (sql_ex.opt_flags&  IGNORE_FLAG)
> -    my_b_printf(&cache,"IGNORE ");
> +    my_b_printf(head,"IGNORE ");
>
> -  my_b_printf(&cache, "INTO TABLE `%s`", table_name);
> -  my_b_printf(&cache, " FIELDS TERMINATED BY ");
> -  pretty_print_str(&cache, sql_ex.field_term, sql_ex.field_term_len);
> +  my_b_printf(head, "INTO TABLE `%s`", table_name);
> +  my_b_printf(head, " FIELDS TERMINATED BY ");
> +  pretty_print_str(head, sql_ex.field_term, sql_ex.field_term_len);
>
>     if (sql_ex.opt_flags&  OPT_ENCLOSED_FLAG)
> -    my_b_printf(&cache," OPTIONALLY ");
> -  my_b_printf(&cache, " ENCLOSED BY ");
> -  pretty_print_str(&cache, sql_ex.enclosed, sql_ex.enclosed_len);
> +    my_b_printf(head," OPTIONALLY ");
> +  my_b_printf(head, " ENCLOSED BY ");
> +  pretty_print_str(head, sql_ex.enclosed, sql_ex.enclosed_len);
>
> -  my_b_printf(&cache, " ESCAPED BY ");
> -  pretty_print_str(&cache, sql_ex.escaped, sql_ex.escaped_len);
> +  my_b_printf(head, " ESCAPED BY ");
> +  pretty_print_str(head, sql_ex.escaped, sql_ex.escaped_len);
>
> -  my_b_printf(&cache," LINES TERMINATED BY ");
> -  pretty_print_str(&cache, sql_ex.line_term, sql_ex.line_term_len);
> +  my_b_printf(head," LINES TERMINATED BY ");
> +  pretty_print_str(head, sql_ex.line_term, sql_ex.line_term_len);
>
>
>     if (sql_ex.line_start)
>     {
> -    my_b_printf(&cache," STARTING BY ");
> -    pretty_print_str(&cache, sql_ex.line_start, sql_ex.line_start_len);
> +    my_b_printf(head," STARTING BY ");
> +    pretty_print_str(head, sql_ex.line_start, sql_ex.line_start_len);
>     }
>     if ((long) skip_lines>  0)
> -    my_b_printf(&cache, " IGNORE %ld LINES", (long) skip_lines);
> +    my_b_printf(head, " IGNORE %ld LINES", (long) skip_lines);
>
>     if (num_fields)
>     {
>       uint i;
>       const char* field = fields;
> -    my_b_printf(&cache, " (");
> +    my_b_printf(head, " (");
>       for (i = 0; i<  num_fields; i++)
>       {
>         if (i)
> -        my_b_printf(&cache, ",");
> -      my_b_printf(&cache, "%s", field);
> +        my_b_printf(head, ",");
> +      my_b_printf(head, "%s", field);
>
>         field += field_lens[i]  + 1;
>       }
> -    my_b_printf(&cache, ")");
> +    my_b_printf(head, ")");
>     }
>
> -  my_b_printf(&cache, "%s\n", print_event_info->delimiter);
> +  my_b_printf(head, "%s\n", print_event_info->delimiter);
>     DBUG_VOID_RETURN;
>   }
>   #endif /* MYSQL_CLIENT */
> @@ -5066,16 +4988,15 @@ void Rotate_log_event::pack_info(Protoco
>   void Rotate_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
>   {
>     char buf[22];
> -  Write_on_release_cache cache(&print_event_info->head_cache, file,
> -                               Write_on_release_cache::FLUSH_F);
> +  IO_CACHE *const head=&print_event_info->head_cache;
>
>     if (print_event_info->short_form)
>       return;
> -  print_header(&cache, print_event_info, FALSE);
> -  my_b_printf(&cache, "\tRotate to ");
> +  print_header(head, print_event_info, FALSE);
> +  my_b_printf(head, "\tRotate to ");
>     if (new_log_ident)
> -    my_b_write(&cache, (uchar*) new_log_ident, (uint)ident_len);
> -  my_b_printf(&cache, "  pos: %s\n", llstr(pos, buf));
> +    my_b_write(head, (uchar*) new_log_ident, (uint)ident_len);
> +  my_b_printf(head, "  pos: %s\n", llstr(pos, buf));
>   }
>   #endif /* MYSQL_CLIENT */
>
> @@ -5330,16 +5251,15 @@ void Intvar_log_event::print(FILE* file,
>     char llbuff[22];
>     const char *msg;
>     LINT_INIT(msg);
> -  Write_on_release_cache cache(&print_event_info->head_cache, file,
> -                               Write_on_release_cache::FLUSH_F);
> +  IO_CACHE *const head=&print_event_info->head_cache;
>
>     if (!print_event_info->short_form)
>     {
> -    print_header(&cache, print_event_info, FALSE);
> -    my_b_printf(&cache, "\tIntvar\n");
> +    print_header(head, print_event_info, FALSE);
> +    my_b_printf(head, "\tIntvar\n");
>     }
>
> -  my_b_printf(&cache, "SET ");
> +  my_b_printf(head, "SET ");
>     switch (type) {
>     case LAST_INSERT_ID_EVENT:
>       msg="LAST_INSERT_ID";
> @@ -5352,7 +5272,7 @@ void Intvar_log_event::print(FILE* file,
>       msg="INVALID_INT";
>       break;
>     }
> -  my_b_printf(&cache, "%s=%s%s\n",
> +  my_b_printf(head, "%s=%s%s\n",
>                 msg, llstr(val,llbuff), print_event_info->delimiter);
>   }
>   #endif
> @@ -5451,16 +5371,15 @@ bool Rand_log_event::write(IO_CACHE* fil
>   #ifdef MYSQL_CLIENT
>   void Rand_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
>   {
> -  Write_on_release_cache cache(&print_event_info->head_cache, file,
> -                               Write_on_release_cache::FLUSH_F);
> +  IO_CACHE *const head=&print_event_info->head_cache;
>
>     char llbuff[22],llbuff2[22];
>     if (!print_event_info->short_form)
>     {
> -    print_header(&cache, print_event_info, FALSE);
> -    my_b_printf(&cache, "\tRand\n");
> +    print_header(head, print_event_info, FALSE);
> +    my_b_printf(head, "\tRand\n");
>     }
> -  my_b_printf(&cache, "SET @@RAND_SEED1=%s, @@RAND_SEED2=%s%s\n",
> +  my_b_printf(head, "SET @@RAND_SEED1=%s, @@RAND_SEED2=%s%s\n",
>                 llstr(seed1, llbuff),llstr(seed2, llbuff2),
>                 print_event_info->delimiter);
>   }
> @@ -5554,18 +5473,17 @@ bool Xid_log_event::write(IO_CACHE* file
>   #ifdef MYSQL_CLIENT
>   void Xid_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
>   {
> -  Write_on_release_cache cache(&print_event_info->head_cache, file,
> -                               Write_on_release_cache::FLUSH_F);
> +  IO_CACHE *const head=&print_event_info->head_cache;
>
>     if (!print_event_info->short_form)
>     {
>       char buf[64];
>       longlong10_to_str(xid, buf, 10);
>
> -    print_header(&cache, print_event_info, FALSE);
> -    my_b_printf(&cache, "\tXid = %s\n", buf);
> +    print_header(head, print_event_info, FALSE);
> +    my_b_printf(head, "\tXid = %s\n", buf);
>     }
> -  my_b_printf(&cache, "COMMIT%s\n", print_event_info->delimiter);
> +  my_b_printf(head, "COMMIT%s\n", print_event_info->delimiter);
>   }
>   #endif /* MYSQL_CLIENT */
>
> @@ -5810,22 +5728,21 @@ bool User_var_log_event::write(IO_CACHE*
>   #ifdef MYSQL_CLIENT
>   void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
>   {
> -  Write_on_release_cache cache(&print_event_info->head_cache, file,
> -                               Write_on_release_cache::FLUSH_F);
> +  IO_CACHE *const head=&print_event_info->head_cache;
>
>     if (!print_event_info->short_form)
>     {
> -    print_header(&cache, print_event_info, FALSE);
> -    my_b_printf(&cache, "\tUser_var\n");
> +    print_header(head, print_event_info, FALSE);
> +    my_b_printf(head, "\tUser_var\n");
>     }
>
> -  my_b_printf(&cache, "SET @`");
> -  my_b_write(&cache, (uchar*) name, (uint) (name_len));
> -  my_b_printf(&cache, "`");
> +  my_b_printf(head, "SET @`");
> +  my_b_write(head, (uchar*) name, (uint) (name_len));
> +  my_b_printf(head, "`");
>
>     if (is_null)
>     {
> -    my_b_printf(&cache, ":=NULL%s\n", print_event_info->delimiter);
> +    my_b_printf(head, ":=NULL%s\n", print_event_info->delimiter);
>     }
>     else
>     {
> @@ -5835,13 +5752,13 @@ void User_var_log_event::print(FILE* fil
>         char real_buf[FMT_G_BUFSIZE(14)];
>         float8get(real_val, val);
>         sprintf(real_buf, "%.14g", real_val);
> -      my_b_printf(&cache, ":=%s%s\n", real_buf,
> print_event_info->delimiter);
> +      my_b_printf(head, ":=%s%s\n", real_buf, print_event_info->delimiter);
>         break;
>       case INT_RESULT:
>         char int_buf[22];
>         longlong10_to_str(uint8korr(val), int_buf,
>                           ((flags&  User_var_log_event::UNSIGNED_F) ? 10 :
> -10));
> -      my_b_printf(&cache, ":=%s%s\n", int_buf, print_event_info->delimiter);
> +      my_b_printf(head, ":=%s%s\n", int_buf, print_event_info->delimiter);
>         break;
>       case DECIMAL_RESULT:
>       {
> @@ -5857,7 +5774,7 @@ void User_var_log_event::print(FILE* fil
>         bin2decimal((uchar*) val+2,&dec, precision, scale);
>         decimal2string(&dec, str_buf,&str_len, 0, 0, 0);
>         str_buf[str_len]= 0;
> -      my_b_printf(&cache, ":=%s%s\n", str_buf, print_event_info->delimiter);
> +      my_b_printf(head, ":=%s%s\n", str_buf, print_event_info->delimiter);
>         break;
>       }
>       case STRING_RESULT:
> @@ -5893,9 +5810,9 @@ void User_var_log_event::print(FILE* fil
>             Generate an unusable command (=>  syntax error) is probably the best
>             thing we can do here.
>           */
> -        my_b_printf(&cache, ":=???%s\n", print_event_info->delimiter);
> +        my_b_printf(head, ":=???%s\n", print_event_info->delimiter);
>         else
> -        my_b_printf(&cache, ":=_%s %s COLLATE `%s`%s\n",
> +        my_b_printf(head, ":=_%s %s COLLATE `%s`%s\n",
>                       cs->csname, hex_str, cs->name,
>                       print_event_info->delimiter);
>         my_afree(hex_str);
> @@ -6024,12 +5941,10 @@ User_var_log_event::do_shall_skip(Relay_
>   #ifdef MYSQL_CLIENT
>   void Unknown_log_event::print(FILE* file_arg, PRINT_EVENT_INFO* print_event_info)
>   {
> -  Write_on_release_cache cache(&print_event_info->head_cache, file_arg);
> -
>     if (print_event_info->short_form)
>       return;
> -  print_header(&cache, print_event_info, FALSE);
> -  my_b_printf(&cache, "\n# %s", "Unknown event\n");
> +  print_header(&print_event_info->head_cache, print_event_info, FALSE);
> +  my_b_printf(&print_event_info->head_cache, "\n# %s", "Unknown event\n");
>   }
>   #endif
>
> @@ -6100,13 +6015,11 @@ Slave_log_event::~Slave_log_event()
>   #ifdef MYSQL_CLIENT
>   void Slave_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
>   {
> -  Write_on_release_cache cache(&print_event_info->head_cache, file);
> -
>     char llbuff[22];
>     if (print_event_info->short_form)
>       return;
> -  print_header(&cache, print_event_info, FALSE);
> -  my_b_printf(&cache, "\n\
> +  print_header(&print_event_info->head_cache, print_event_info, FALSE);
> +  my_b_printf(&print_event_info->head_cache, "\n\
>   Slave: master_host: '%s'  master_port: %d  master_log: '%s'  master_pos: %s\n",
>   	  master_host, master_port, master_log, llstr(master_pos, llbuff));
>   }
> @@ -6186,14 +6099,11 @@ int Slave_log_event::do_apply_event(Rela
>   #ifdef MYSQL_CLIENT
>   void Stop_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
>   {
> -  Write_on_release_cache cache(&print_event_info->head_cache, file,
> -                               Write_on_release_cache::FLUSH_F);
> -
>     if (print_event_info->short_form)
>       return;
>
> -  print_header(&cache, print_event_info, FALSE);
> -  my_b_printf(&cache, "\tStop\n");
> +  print_header(&print_event_info->head_cache, print_event_info, FALSE);
> +  my_b_printf(&print_event_info->head_cache, "\tStop\n");
>   }
>   #endif /* MYSQL_CLIENT */
>
> @@ -6372,8 +6282,6 @@ Create_file_log_event::Create_file_log_e
>   void Create_file_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info,
>   				  bool enable_local)
>   {
> -  Write_on_release_cache cache(&print_event_info->head_cache, file);
> -
>     if (print_event_info->short_form)
>     {
>       if (enable_local&&  check_fname_outside_temp_buf())
> @@ -6389,10 +6297,11 @@ void Create_file_log_event::print(FILE*
>          That one is for "file_id: etc" below: in mysqlbinlog we want the #, in
>          SHOW BINLOG EVENTS we don't.
>       */
> -    my_b_printf(&cache, "#");
> +    my_b_printf(&print_event_info->head_cache, "#");
>     }
>
> -  my_b_printf(&cache, " file_id: %d  block_len: %d\n", file_id, block_len);
> +  my_b_printf(&print_event_info->head_cache,
> +              " file_id: %d  block_len: %d\n", file_id, block_len);
>   }
>
>
> @@ -6577,12 +6486,11 @@ bool Append_block_log_event::write(IO_CA
>   void Append_block_log_event::print(FILE* file,
>   				   PRINT_EVENT_INFO* print_event_info)
>   {
> -  Write_on_release_cache cache(&print_event_info->head_cache, file);
> -
>     if (print_event_info->short_form)
>       return;
> -  print_header(&cache, print_event_info, FALSE);
> -  my_b_printf(&cache, "\n#%s: file_id: %d  block_len: %d\n",
> +  print_header(&print_event_info->head_cache, print_event_info, FALSE);
> +  my_b_printf(&print_event_info->head_cache,
> +              "\n#%s: file_id: %d  block_len: %d\n",
>                 get_type_str(), file_id, block_len);
>   }
>   #endif /* MYSQL_CLIENT */
> @@ -6736,12 +6644,11 @@ bool Delete_file_log_event::write(IO_CAC
>   void Delete_file_log_event::print(FILE* file,
>   				  PRINT_EVENT_INFO* print_event_info)
>   {
> -  Write_on_release_cache cache(&print_event_info->head_cache, file);
> -
>     if (print_event_info->short_form)
>       return;
> -  print_header(&cache, print_event_info, FALSE);
> -  my_b_printf(&cache, "\n#Delete_file: file_id=%u\n", file_id);
> +  print_header(&print_event_info->head_cache, print_event_info, FALSE);
> +  my_b_printf(&print_event_info->head_cache,
> +              "\n#Delete_file: file_id=%u\n", file_id);
>   }
>   #endif /* MYSQL_CLIENT */
>
> @@ -6833,12 +6740,10 @@ bool Execute_load_log_event::write(IO_CA
>   void Execute_load_log_event::print(FILE* file,
>   				   PRINT_EVENT_INFO* print_event_info)
>   {
> -  Write_on_release_cache cache(&print_event_info->head_cache, file);
> -
>     if (print_event_info->short_form)
>       return;
> -  print_header(&cache, print_event_info, FALSE);
> -  my_b_printf(&cache, "\n#Exec_load: file_id=%d\n",
> +  print_header(&print_event_info->head_cache, print_event_info, FALSE);
> +  my_b_printf(&print_event_info->head_cache, "\n#Exec_load: file_id=%d\n",
>                 file_id);
>   }
>   #endif
> @@ -7073,30 +6978,30 @@ void Execute_load_query_log_event::print
>                                            PRINT_EVENT_INFO* print_event_info,
>                                            const char *local_fname)
>   {
> -  Write_on_release_cache cache(&print_event_info->head_cache, file);
> +  IO_CACHE *const head=&print_event_info->head_cache;
>
> -  print_query_header(&cache, print_event_info);
> +  print_query_header(head, print_event_info);
>
>     if (local_fname)
>     {
> -    my_b_write(&cache, (uchar*) query, fn_pos_start);
> -    my_b_printf(&cache, " LOCAL INFILE \'");
> -    my_b_printf(&cache, "%s", local_fname);
> -    my_b_printf(&cache, "\'");
> +    my_b_write(head, (uchar*) query, fn_pos_start);
> +    my_b_printf(head, " LOCAL INFILE \'");
> +    my_b_printf(head, "%s", local_fname);
> +    my_b_printf(head, "\'");
>       if (dup_handling == LOAD_DUP_REPLACE)
> -      my_b_printf(&cache, " REPLACE");
> -    my_b_printf(&cache, " INTO");
> -    my_b_write(&cache, (uchar*) query + fn_pos_end, q_len-fn_pos_end);
> -    my_b_printf(&cache, "\n%s\n", print_event_info->delimiter);
> +      my_b_printf(head, " REPLACE");
> +    my_b_printf(head, " INTO");
> +    my_b_write(head, (uchar*) query + fn_pos_end, q_len-fn_pos_end);
> +    my_b_printf(head, "\n%s\n", print_event_info->delimiter);
>     }
>     else
>     {
> -    my_b_write(&cache, (uchar*) query, q_len);
> -    my_b_printf(&cache, "\n%s\n", print_event_info->delimiter);
> +    my_b_write(head, (uchar*) query, q_len);
> +    my_b_printf(head, "\n%s\n", print_event_info->delimiter);
>     }
>
>     if (!print_event_info->short_form)
> -    my_b_printf(&cache, "# file_id: %d \n", file_id);
> +    my_b_printf(head, "# file_id: %d \n", file_id);
>   }
>   #endif
>
> @@ -8078,12 +7983,6 @@ void Rows_log_event::print_helper(FILE *
>                   last_stmt_event ? " flags: STMT_END_F" : "");
>       print_base64(body, print_event_info, !last_stmt_event);
>     }
> -
> -  if (get_flags(STMT_END_F))
> -  {
> -    copy_event_cache_to_file_and_reinit(head, file);
> -    copy_event_cache_to_file_and_reinit(body, file);
> -  }
>   }
>   #endif
>
> @@ -9767,9 +9666,10 @@ Incident_log_event::print(FILE *file,
>     if (print_event_info->short_form)
>       return;
>
> -  Write_on_release_cache cache(&print_event_info->head_cache, file);
> -  print_header(&cache, print_event_info, FALSE);
> -  my_b_printf(&cache, "\n# Incident: %s\nRELOAD DATABASE; # Shall generate
> syntax error\n", description());
> +  print_header(&print_event_info->head_cache, print_event_info, FALSE);
> +  my_b_printf(&print_event_info->head_cache,
> +              "\n# Incident: %s\nRELOAD DATABASE; # Shall generate syntax error\n",
> +              description());
>   }
>   #endif
>
> @@ -9836,10 +9736,10 @@ Ignorable_log_event::print(FILE *file,
>     if (print_event_info->short_form)
>       return;
>
> -  Write_on_release_cache cache(&print_event_info->head_cache, file);
> -  print_header(&cache, print_event_info, FALSE);
> -  my_b_printf(&cache, "\tIgnorable\n");
> -  my_b_printf(&cache, "# Unrecognized ignorable event\n");
> +  print_header(&print_event_info->head_cache, print_event_info, FALSE);
> +  my_b_printf(&print_event_info->head_cache, "\tIgnorable\n");
> +  my_b_printf(&print_event_info->head_cache,
> +              "# Unrecognized ignorable event\n");
>   }
>   #endif
>
> @@ -9891,18 +9791,17 @@ void Rows_query_log_event::pack_info(Pro
>   #ifdef MYSQL_CLIENT
>   void
>   Rows_query_log_event::print(FILE *file,
> -                         PRINT_EVENT_INFO *print_event_info)
> +                            PRINT_EVENT_INFO *print_event_info)
>   {
> -  if (print_event_info->short_form)
> -    return;
> -
> -  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);
> -
> -  IO_CACHE *const body=&print_event_info->body_cache;
> -  print_base64(body, print_event_info, true);
> +  if (!print_event_info->short_form&&  print_event_info->verbose> 
> 1)
> +  {
> +    IO_CACHE *const head=&print_event_info->head_cache;
> +    IO_CACHE *const body=&print_event_info->body_cache;
> +    print_header(head, print_event_info, FALSE);
> +    my_b_printf(head, "\tRows_query\n");
> +    my_b_printf(head, "# %s\n", m_rows_query);
> +    print_base64(body, print_event_info, true);
> +  }
>   }
>   #endif
>
>
> === modified file 'sql/log_event_old.cc'
> --- a/sql/log_event_old.cc	2010-07-28 23:39:52 +0000
> +++ b/sql/log_event_old.cc	2010-10-27 06:22:33 +0000
> @@ -1938,12 +1938,6 @@ void Old_rows_log_event::print_helper(FI
>                   last_stmt_event ? " flags: STMT_END_F" : "");
>       print_base64(body, print_event_info, !last_stmt_event);
>     }
> -
> -  if (get_flags(STMT_END_F))
> -  {
> -    copy_event_cache_to_file_and_reinit(head, file);
> -    copy_event_cache_to_file_and_reinit(body, file);
> -  }
>   }
>   #endif
>
>
>
>
>
>

Thread
bzr commit into mysql-next-mr-bugfixing branch (Dao-Gang.Qu:3324) Bug#55790Dao-Gang.Qu27 Oct
  • Re: bzr commit into mysql-next-mr-bugfixing branch (Dao-Gang.Qu:3324)Bug#55790Sven Sandberg27 Oct
    • Re: bzr commit into mysql-next-mr-bugfixing branch (Dao-Gang.Qu:3324)Bug#55790Daogang Qu28 Oct