~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/suite/falcon/t/rpl_falcon_bug_37221.test

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# BUG#37221: SET AUTOCOMMIT=1 does not commit binary log
 
2
 
 
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.
 
6
 
 
7
--source include/have_falcon.inc
 
8
--source include/master-slave.inc
 
9
 
 
10
--echo [master]
 
11
connection master;
 
12
SET BINLOG_FORMAT = 'ROW';
 
13
 
 
14
CREATE TABLE IF NOT EXISTS t1 (id INT) ENGINE = Falcon;
 
15
 
 
16
# When switching to AUTOCOMMIT=1, there is an implicit commit if we
 
17
# are outside a real transaction.
 
18
 
 
19
SET AUTOCOMMIT=0;
 
20
INSERT INTO t1 VALUES (1);
 
21
SET AUTOCOMMIT=1;
 
22
SELECT * FROM t1;
 
23
--echo [slave]
 
24
sync_slave_with_master;
 
25
SELECT * FROM t1;
 
26
 
 
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).
 
31
 
 
32
--echo [master]
 
33
connection master;
 
34
BEGIN;
 
35
INSERT INTO t1 VALUES (2);
 
36
SET AUTOCOMMIT=1;
 
37
 
 
38
--echo [slave]
 
39
connection slave;
 
40
SELECT * FROM t1 /* Should not contain 2 */;
 
41
 
 
42
--echo [master]
 
43
connection master;
 
44
INSERT INTO t1 VALUES (3);
 
45
COMMIT;
 
46
 
 
47
--echo [slave]
 
48
sync_slave_with_master;
 
49
SELECT * FROM t1 /* Should contain 2 and 3 */;
 
50
 
 
51
--echo [master]
 
52
connection master;
 
53
DROP TABLE t1;
 
54
sync_slave_with_master;