1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
# This is a test of various SQL statements
# and looks at the statement and transaction
# boundaries (start/end) to ensure they are sane
SET AUTOCOMMIT= 0;
# Expect 0 commit count since nothing
# has yet happened...
SHOW STATUS LIKE 'Handler_commit%';
BEGIN;
# Expect 0 commit count since nothing
# has yet been committed...
SHOW STATUS LIKE 'Handler_commit%';
COMMIT;
DROP SCHEMA IF EXISTS boundaries;
# Expect 1 commit count since above COMMIT before DROP SCHEMA
#
# When we get transactional DDL, should be 0.
SHOW STATUS LIKE 'Handler_commit%';
COMMIT;
# Expect 1 commit count since
# an explicit call to COMMIT was made
# even though nothing was changed...
SHOW STATUS LIKE 'Handler_commit%';
## Enable AUOTOCOMMIT
#
SET AUTOCOMMIT= 1;
SHOW STATUS LIKE 'Handler_commit%';
DROP SCHEMA IF EXISTS boundaries;
BEGIN;
COMMIT;
SHOW STATUS LIKE 'Handler_commit%';
CREATE TABLE commit_test (a int);
SHOW STATUS LIKE 'Handler_commit%';
INSERT into commit_test VALUES (10);
SHOW STATUS LIKE 'Handler_commit%';
INSERT into commit_test VALUES (10), (20);
SHOW STATUS LIKE 'Handler_commit%';
INSERT into commit_test VALUES (10);
SHOW STATUS LIKE 'Handler_commit%';
BEGIN;
INSERT into commit_test VALUES (10);
SHOW STATUS LIKE 'Handler_commit%';
COMMIT;
SHOW STATUS LIKE 'Handler_commit%';
BEGIN;
INSERT into commit_test VALUES (10);
SHOW STATUS LIKE 'Handler_commit%';
ROLLBACK;
SHOW STATUS LIKE 'Handler_commit%';
BEGIN;
INSERT into commit_test VALUES (10);
SHOW STATUS LIKE 'Handler_commit%';
COMMIT;
SHOW STATUS LIKE 'Handler_commit%';
SET AUTOCOMMIT= 0;
INSERT into commit_test VALUES (10);
INSERT into commit_test VALUES (10);
SHOW STATUS LIKE 'Handler_commit%';
COMMIT;
drop table commit_test;
SHOW STATUS LIKE 'Handler_commit%';
|