List:Commits« Previous MessageNext Message »
From:Manish Kumar Date:October 10 2011 6:23am
Subject:bzr push into mysql-trunk branch (manish.4.kumar:3481 to 3482) Bug#11747887
View as plain text  
 3482 Manish Kumar	2011-10-10
      BUG#11747887:34386: MYSQLBINLOG --HEXDUMP PRINTS LAST ROW OF HEXDUMP INCORRECTLY 
      
      Problem description: when mysqlbinlog --hexdump prints events, it prints the last row of the
                           hexdump incorrectly.
                           If the last row has eight bytes,the end of the second last row is 
                           copied to the end of the last row,padding the row to full length.
                           If the last row has less than sixteen bytes, the textual 
                           representation is not aligned with the previous row.
             
      Fix: the bug was removed by padding the last line with the required 
           number of spaces in the last line.
     @ mysql-test/std_data/bug11747887-bin.000002
        Added the binlog file for the BUG#11747887.
     @ mysql-test/suite/rpl/r/binlog-hexdump.result
        Added the result file for the BUG#11747887 which has the proper alignment for the hexdump.
     @ mysql-test/suite/rpl/t/binlog-hexdump.test
        Added a test case for the BUG#11747887.
     @ sql/log_event.cc
        We appended the hexdump with the required number of spaces, to align the output
        in the required format.
        
        pad_length - gives the value of the required number of spaces to be padded.

    added:
      mysql-test/std_data/bug11747887-bin.000002
      mysql-test/suite/rpl/r/binlog-hexdump.result
      mysql-test/suite/rpl/t/binlog-hexdump.test
    modified:
      sql/log_event.cc
 3481 Sergey Vojtovich	2011-10-08
      BUG#11756687 - 48633: ARCHIVE TABLES ARE NOT UPGRADEABLE
      
      This addition fixes main.archive failure.
      
      Archive didn't read blobs from original table while
      performing REPAIR TABLE with non-debug builds.
     @ storage/archive/ha_archive.cc
        Mark all columns for read independently of DBUG state.
        It instructs ::get_row_version2() to read all blobs.

    modified:
      storage/archive/ha_archive.cc
=== added file 'mysql-test/std_data/bug11747887-bin.000002'
Binary files a/mysql-test/std_data/bug11747887-bin.000002	1970-01-01 00:00:00 +0000 and b/mysql-test/std_data/bug11747887-bin.000002	2011-10-10 06:22:13 +0000 differ

=== added file 'mysql-test/suite/rpl/r/binlog-hexdump.result'
--- a/mysql-test/suite/rpl/r/binlog-hexdump.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/binlog-hexdump.result	2011-10-10 06:22:13 +0000
@@ -0,0 +1,88 @@
+include/master-slave.inc
+[connection master]
+include/rpl_reset.inc
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# at 4
+#110927 20:57:19 server id 1  end_log_pos 114 
+# Position  Timestamp   Type   Master ID        Size      Master Pos    Flags 
+#        4 7f 0e 82 4e   0f   01 00 00 00   6e 00 00 00   72 00 00 00   00 00
+#       17 04 00 35 2e 36 2e 34 2d  6d 35 2d 64 65 62 75 67 |..5.6.4.m5.debug|
+#       27 2d 6c 6f 67 00 00 00 00  00 00 00 00 00 00 00 00 |.log............|
+#       37 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00 |................|
+#       47 00 00 00 00 7f 0e 82 4e  13 38 0d 00 08 00 12 00 |.......N.8......|
+#       57 04 04 04 04 12 00 00 56  00 04 1a 08 00 00 00 08 |.......V........|
+#       67 08 08 02 00 00 00 00 93  fa cd dc                |...........|
+# 	Start: binlog v 4, server v 5.6.4-m5-debug-log created 110927 20:57:19 at startup
+ROLLBACK/*!*/;
+BINLOG '
+fw6CTg8BAAAAbgAAAHIAAAAAAAQANS42LjQtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAB/DoJOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAJP6zdw=
+'/*!*/;
+# at 114
+#110927 20:57:23 server id 1  end_log_pos 231 
+# Position  Timestamp   Type   Master ID        Size      Master Pos    Flags 
+#       72 83 0e 82 4e   02   01 00 00 00   75 00 00 00   e7 00 00 00   00 00
+#       85 01 00 00 00 00 00 00 00  04 00 00 21 00 00 00 00 |................|
+#       95 00 00 01 00 00 00 00 00  00 00 00 06 03 73 74 64 |.............std|
+#       a5 04 21 00 21 00 08 00 0c  01 74 65 73 74 00 74 65 |.........test.te|
+#       b5 73 74 00 63 72 65 61 74  65 20 74 61 62 6c 65 20 |st.create.table.|
+#       c5 74 31 20 28 61 20 65 6e  75 6d 28 27 6f 6e 65 27 |t1..a.enum..one.|
+#       d5 2c 20 27 74 77 6f 27 2c  20 27 74 68 72 65 65 27 |...two....three.|
+#       e5 29 29                                            |..|
+# 	Query	thread_id=1	exec_time=0	error_code=0
+use test/*!*/;
+SET TIMESTAMP=1317146243/*!*/;
+SET @@session.pseudo_thread_id=1/*!*/;
+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 utf8 *//*!*/;
+SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+create table t1 (a enum('one', 'two', 'three'))
+/*!*/;
+# at 231
+#110927 20:57:25 server id 1  end_log_pos 306 
+# Position  Timestamp   Type   Master ID        Size      Master Pos    Flags 
+#       e7 85 0e 82 4e   02   01 00 00 00   4b 00 00 00   32 01 00 00   08 00
+#       fa 01 00 00 00 00 00 00 00  04 00 00 21 00 00 00 00 |................|
+#      10a 00 00 01 00 00 00 00 00  00 00 00 06 03 73 74 64 |.............std|
+#      11a 04 21 00 21 00 08 00 0c  01 74 65 73 74 00 74 65 |.........test.te|
+#      12a 73 74 00 42 45 47 49 4e                          |st.BEGIN|
+# 	Query	thread_id=1	exec_time=0	error_code=0
+SET TIMESTAMP=1317146245/*!*/;
+BEGIN
+/*!*/;
+# at 306
+#110927 20:57:25 server id 1  end_log_pos 405 
+# Position  Timestamp   Type   Master ID        Size      Master Pos    Flags 
+#      132 85 0e 82 4e   02   01 00 00 00   63 00 00 00   95 01 00 00   00 00
+#      145 01 00 00 00 00 00 00 00  04 00 00 21 00 00 00 00 |................|
+#      155 00 00 01 00 00 00 00 00  00 00 00 06 03 73 74 64 |.............std|
+#      165 04 21 00 21 00 08 00 0c  01 74 65 73 74 00 74 65 |.........test.te|
+#      175 73 74 00 69 6e 73 65 72  74 20 69 6e 74 6f 20 74 |st.insert.into.t|
+#      185 31 20 76 61 6c 75 65 73  20 28 27 74 77 6f 27 29 |1.values...two..|
+# 	Query	thread_id=1	exec_time=0	error_code=0
+SET TIMESTAMP=1317146245/*!*/;
+insert into t1 values ('two')
+/*!*/;
+# at 405
+#110927 20:57:25 server id 1  end_log_pos 432 
+# Position  Timestamp   Type   Master ID        Size      Master Pos    Flags 
+#      195 85 0e 82 4e   10   01 00 00 00   1b 00 00 00   b0 01 00 00   00 00
+#      1a8 07 00 00 00 00 00 00 00                          |........|
+# 	Xid = 7
+COMMIT/*!*/;
+# at 432
+#110927 20:57:30 server id 1  end_log_pos 451 
+# Position  Timestamp   Type   Master ID        Size      Master Pos    Flags 
+#      1b0 8a 0e 82 4e   03   01 00 00 00   13 00 00 00   c3 01 00 00   00 00
+# 	Stop
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+include/rpl_end.inc

=== added file 'mysql-test/suite/rpl/t/binlog-hexdump.test'
--- a/mysql-test/suite/rpl/t/binlog-hexdump.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/binlog-hexdump.test	2011-10-10 06:22:13 +0000
@@ -0,0 +1,15 @@
+#
+# Bug#11747887 - 34386: MYSQLBINLOG --HEXDUMP PRINTS LAST ROW OF HEXDUMP
+# INCORRECTLY
+#
+
+--source include/master-slave.inc
+--source include/rpl_reset.inc
+
+--sync_slave_with_master
+
+--let $MYSQLD_DATADIR= `select @@datadir`
+
+--exec $MYSQL_BINLOG --hexdump std_data/bug11747887-bin.000002
+
+--source include/rpl_end.inc

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2011-09-22 10:14:00 +0000
+++ b/sql/log_event.cc	2011-10-10 06:22:13 +0000
@@ -1677,6 +1677,11 @@ void Log_event::print_header(IO_CACHE* f
     if (hex_string[0])
     {
       char emit_buf[256];
+      int pad_length= 48 - strlen(h);
+      DBUG_ASSERT(strlen(h) < 48);
+      for(int pad_done= 0; pad_done < pad_length; pad_done++)
+        *h++ = ' ';
+      *h= '\0';
       size_t const bytes_written=
         my_snprintf(emit_buf, sizeof(emit_buf),
                     "# %8.8lx %-48.48s |%s|\n",

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (manish.4.kumar:3481 to 3482) Bug#11747887Manish Kumar10 Oct