MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
binlog_implicit_commit.inc
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 # We need a transactional engine, so let's use InnoDB
6 CREATE TABLE t1 (id INT) ENGINE = InnoDB;
7 
8 # Testing SET AUTOCOMMIT
9 SET BINLOG_FORMAT = STATEMENT;
10 
11 let $cleanup = COMMIT;
12 
13 let $prepare = SET AUTOCOMMIT = 0;
14 let $statement = SET AUTOCOMMIT = 1;
15 source extra/binlog_tests/implicit.test;
16 
17 let $prepare = SET AUTOCOMMIT = 1;
18 let $statement = SET AUTOCOMMIT = 1;
19 source extra/binlog_tests/implicit.test;
20 
21 let $prepare = SET AUTOCOMMIT = 0;
22 let $statement = SET AUTOCOMMIT = 0;
23 source extra/binlog_tests/implicit.test;
24 
25 let $prepare = SET AUTOCOMMIT = 1;
26 let $statement = SET AUTOCOMMIT = 0;
27 source extra/binlog_tests/implicit.test;
28 
29 SET BINLOG_FORMAT = ROW;
30 let $prepare = SET AUTOCOMMIT = 0;
31 let $statement = SET AUTOCOMMIT = 1;
32 source extra/binlog_tests/implicit.test;
33 
34 let $prepare = SET AUTOCOMMIT = 1;
35 let $statement = SET AUTOCOMMIT = 1;
36 source extra/binlog_tests/implicit.test;
37 
38 let $prepare = SET AUTOCOMMIT = 0;
39 let $statement = SET AUTOCOMMIT = 0;
40 source extra/binlog_tests/implicit.test;
41 
42 let $prepare = SET AUTOCOMMIT = 1;
43 let $statement = SET AUTOCOMMIT = 0;
44 source extra/binlog_tests/implicit.test;
45 
46 RESET MASTER;
47 SET AUTOCOMMIT = 0;
48 INSERT INTO t1 VALUES (1);
49 source include/show_binlog_events.inc;
50 LOCK TABLES t1 WRITE;
51 source include/show_binlog_events.inc;
52 INSERT INTO t1 VALUES (2);
53 source include/show_binlog_events.inc;
54 UNLOCK TABLES;
55 source include/show_binlog_events.inc;
56 COMMIT;
57 source include/show_binlog_events.inc;
58 
59 # Cleaning up
60 DROP TABLE t1;