Debian Codegraph @

mysql-test/suite/binlog/t/binlog_implicit_commit.test

raw
1 # The purpose of this test is to test that setting autocommit does a
2 # commit of outstanding transactions and nothing is left pending in
3 # the transaction cache.
4
5 source include/have_log_bin.inc;
6 source include/have_innodb.inc;
7
8 # We need a transactional engine, so let's use InnoDB
9 CREATE TABLE t1 (id INT) ENGINE = InnoDB;
10
11 # Testing SET AUTOCOMMIT
12 SET BINLOG_FORMAT = STATEMENT;
13
14 let $cleanup = COMMIT;
15
16 let $prepare = SET AUTOCOMMIT = 0;
17 let $statement = SET AUTOCOMMIT = 1;
18 source include/implicit.test;
19
20 let $prepare = SET AUTOCOMMIT = 1;
21 let $statement = SET AUTOCOMMIT = 1;
22 source include/implicit.test;
23
24 let $prepare = SET AUTOCOMMIT = 0;
25 let $statement = SET AUTOCOMMIT = 0;
26 source include/implicit.test;
27
28 let $prepare = SET AUTOCOMMIT = 1;
29 let $statement = SET AUTOCOMMIT = 0;
30 source include/implicit.test;
31
32 SET BINLOG_FORMAT = ROW;
33 let $prepare = SET AUTOCOMMIT = 0;
34 let $statement = SET AUTOCOMMIT = 1;
35 source include/implicit.test;
36
37 let $prepare = SET AUTOCOMMIT = 1;
38 let $statement = SET AUTOCOMMIT = 1;
39 source include/implicit.test;
40
41 let $prepare = SET AUTOCOMMIT = 0;
42 let $statement = SET AUTOCOMMIT = 0;
43 source include/implicit.test;
44
45 let $prepare = SET AUTOCOMMIT = 1;
46 let $statement = SET AUTOCOMMIT = 0;
47 source include/implicit.test;
48
49 RESET MASTER;
50 SET AUTOCOMMIT = 0;
51 INSERT INTO t1 VALUES (1);
52 source include/show_binlog_events.inc;
53 LOCK TABLES t1 WRITE;
54 source include/show_binlog_events.inc;
55 INSERT INTO t1 VALUES (2);
56 source include/show_binlog_events.inc;
57 UNLOCK TABLES;
58 source include/show_binlog_events.inc;
59 COMMIT;
60 source include/show_binlog_events.inc;
61
62 # Cleaning up
63 DROP TABLE t1;