mariadb/mysql-test/suite/ndb/t/ndb_binlog_format.test
Alfranio Correia 19c380aaff 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.
2009-11-03 19:02:56 +00:00

35 lines
1.1 KiB
Text

#
# test different behavior of ndb using different binlog formats
#
-- source include/have_blackhole.inc
-- 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
#
# Bug #29222 Statement mode replicates both statement and
# rows when writing to an NDB table
#
CREATE TABLE t1 (m INT, n INT) ENGINE=MYISAM;
CREATE TABLE t2 (b INT, c INT) ENGINE=BLACKHOLE;
CREATE TABLE t3 (e INT, f INT) ENGINE=NDB;
RESET MASTER;
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;
# A transaction here is not necessary, but I wanted to group the bad statements
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;
UPDATE t3, t2 SET e = 2, b = 3 WHERE f = c;
COMMIT;
--source include/show_binlog_events.inc
DROP TABLE t1, t2, t3;