[Commits] Rev 3232: MDEV-6067: Partitioned table DML sometimes binlogged without XID event in http://bazaar.launchpad.net/~maria-captains/maria/5.2

knielsen at knielsen-hq.org knielsen at knielsen-hq.org
Fri Apr 11 10:03:54 EEST 2014


At http://bazaar.launchpad.net/~maria-captains/maria/5.2

------------------------------------------------------------
revno: 3232
revision-id: knielsen at knielsen-hq.org-20140411070353-pln22m942ta021w4
parent: knielsen at knielsen-hq.org-20140411063948-8qs97uq8vig06i0s
committer: knielsen at knielsen-hq.org
branch nick: mariadb-5.2
timestamp: Fri 2014-04-11 09:03:53 +0200
message:
  MDEV-6067: Partitioned table DML sometimes binlogged without XID event
  
  Add test case.
=== added file 'mysql-test/suite/parts/r/partition_mdev6067.result'
--- a/mysql-test/suite/parts/r/partition_mdev6067.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/r/partition_mdev6067.result	2014-04-11 07:03:53 +0000
@@ -0,0 +1,38 @@
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
+PARTITION BY KEY (a) PARTITIONS 2;
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (2,2), (3,8);
+INSERT INTO t1 VALUES (4,16);
+show binlog events in 'master-bin.000001' from <binlog_start>;
+Log_name        Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001       #       Query   #       #       BEGIN
+master-bin.000001       #       Query   #       #       use `test`; INSERT INTO t1 VALUES (1,1)
+master-bin.000001       #       Xid     #       #       COMMIT /* XID */
+master-bin.000001       #       Query   #       #       BEGIN
+master-bin.000001       #       Query   #       #       use `test`; INSERT INTO t1 VALUES (2,2), (3,8)
+master-bin.000001       #       Xid     #       #       COMMIT /* XID */
+master-bin.000001       #       Query   #       #       BEGIN
+master-bin.000001       #       Query   #       #       use `test`; INSERT INTO t1 VALUES (4,16)
+master-bin.000001       #       Xid     #       #       COMMIT /* XID */
+DROP TABLE t1;
+SET binlog_format='row';
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
+PARTITION BY KEY (a) PARTITIONS 2;
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (2,2), (3,8);
+INSERT INTO t1 VALUES (4,16);
+show binlog events in 'master-bin.000001' from <binlog_start>;
+Log_name        Pos     Event_type      Server_id       End_log_pos     Info
+master-bin.000001       #       Query   #       #       BEGIN
+master-bin.000001       #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001       #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001       #       Xid     #       #       COMMIT /* XID */
+master-bin.000001       #       Query   #       #       BEGIN
+master-bin.000001       #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001       #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001       #       Xid     #       #       COMMIT /* XID */
+master-bin.000001       #       Query   #       #       BEGIN
+master-bin.000001       #       Table_map       #       #       table_id: # (test.t1)
+master-bin.000001       #       Write_rows      #       #       table_id: # flags: STMT_END_F
+master-bin.000001       #       Xid     #       #       COMMIT /* XID */
+DROP TABLE t1;

=== added file 'mysql-test/suite/parts/t/partition_mdev6067.test'
--- a/mysql-test/suite/parts/t/partition_mdev6067.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/parts/t/partition_mdev6067.test	2014-04-11 07:03:53 +0000
@@ -0,0 +1,32 @@
+--source include/have_innodb.inc
+--source include/have_partition.inc
+--source include/have_binlog_format_statement.inc
+
+# Test binlogging of some transactions on a partitioned InnoDB table.
+# The bug was seen as one of the inserts being logged with a COMMIT query
+# event instead of the correct XID event.
+
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
+  PARTITION BY KEY (a) PARTITIONS 2;
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1)
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (2,2), (3,8);
+INSERT INTO t1 VALUES (4,16);
+
+--source include/show_binlog_events.inc
+
+# Same thing in row mode.
+DROP TABLE t1;
+SET binlog_format='row';
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB
+  PARTITION BY KEY (a) PARTITIONS 2;
+--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1)
+INSERT INTO t1 VALUES (1,1);
+INSERT INTO t1 VALUES (2,2), (3,8);
+INSERT INTO t1 VALUES (4,16);
+
+--source include/show_binlog_events.inc
+
+DROP TABLE t1;



More information about the commits mailing list