From 60d4662496c0831753085b172d70b39d98164892 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Tue, 3 Nov 2009 19:02:56 +0000 Subject: WL#2687 WL#5072 BUG#40278 BUG#47175 Non-transactional updates that take place inside a transaction present problems for logging because they are visible to other clients before the transaction is committed, and they are not rolled back even if the transaction is rolled back. It is not always possible to log correctly in statement format when both transactional and non-transactional tables are used in the same transaction. In the current patch, we ensure that such scenario is completely safe under the ROW and MIXED modes. --- mysql-test/suite/ndb/r/ndb_binlog_format.result | 9 +++++++++ mysql-test/suite/ndb/t/ndb_binlog_format.test | 2 ++ 2 files changed, 11 insertions(+) (limited to 'mysql-test/suite/ndb') diff --git a/mysql-test/suite/ndb/r/ndb_binlog_format.result b/mysql-test/suite/ndb/r/ndb_binlog_format.result index 6e1fc12130f..62d491bc94a 100644 --- a/mysql-test/suite/ndb/r/ndb_binlog_format.result +++ b/mysql-test/suite/ndb/r/ndb_binlog_format.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); drop table if exists t1, t2, t3; CREATE TABLE t1 (m INT, n INT) ENGINE=MYISAM; CREATE TABLE t2 (b INT, c INT) ENGINE=BLACKHOLE; @@ -7,18 +8,26 @@ SET SESSION BINLOG_FORMAT=STATEMENT; INSERT INTO t1 VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t2 VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1, t2 SET m = 2, b = 3 WHERE n = c; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. START TRANSACTION; INSERT INTO t3 VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. UPDATE t3, t2 SET e = 2, b = 3 WHERE f = c; COMMIT; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (1,2), (2,1), (2,2) +mysqld-bin.000001 # Query # # COMMIT mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (1,1), (1,2), (2,1), (2,2) mysqld-bin.000001 # Query # # COMMIT +mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; UPDATE t1, t2 SET m = 2, b = 3 WHERE n = c +mysqld-bin.000001 # Query # # COMMIT mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (1,1), (1,2), (2,1), (2,2) mysqld-bin.000001 # Query # # use `test`; UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f diff --git a/mysql-test/suite/ndb/t/ndb_binlog_format.test b/mysql-test/suite/ndb/t/ndb_binlog_format.test index acb34bb388c..994054f0676 100644 --- a/mysql-test/suite/ndb/t/ndb_binlog_format.test +++ b/mysql-test/suite/ndb/t/ndb_binlog_format.test @@ -6,6 +6,8 @@ -- source include/have_ndb.inc -- source include/have_log_bin.inc +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); + --disable_warnings drop table if exists t1, t2, t3; --enable_warnings -- cgit v1.2.1