1
# BUG#37221: SET AUTOCOMMIT=1 does not commit binary log
3
# Regression test to ensure that the bug does not re-appear. The test
4
# is using the Falcon engine, but the problem is a generic case. See
5
# binlog_implicit_commit.test for a more elaborate test.
7
--source include/have_falcon.inc
8
--source include/master-slave.inc
12
SET BINLOG_FORMAT = 'ROW';
14
CREATE TABLE IF NOT EXISTS t1 (id INT) ENGINE = Falcon;
16
# When switching to AUTOCOMMIT=1, there is an implicit commit if we
17
# are outside a real transaction.
20
INSERT INTO t1 VALUES (1);
24
sync_slave_with_master;
27
# When inside a transaction, AUTOCOMMIT=1 should not commit the
28
# transaction. This is hard to test for sure (since delays might cause
29
# the transaction to not propagate fast enough), but it will not cause
30
# any false negatives (just false positives).
35
INSERT INTO t1 VALUES (2);
40
SELECT * FROM t1 /* Should not contain 2 */;
44
INSERT INTO t1 VALUES (3);
48
sync_slave_with_master;
49
SELECT * FROM t1 /* Should contain 2 and 3 */;
54
sync_slave_with_master;