1
connect (a,localhost,root,,);
2
connect (b,localhost,root,,);
6
CREATE TABLE t1 (a int);
7
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
9
INSERT INTO t1 values (1);
13
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
19
INSERT INTO t1 values (2);
34
SELECT * from t1 order by a;
37
SELECT * from t1 order by a;
45
# This is a test of various SQL statements
46
# and looks at the statement and transaction
47
# boundaries (start/end) to ensure they are sane
51
# Expect 0 commit count since nothing
54
SHOW STATUS LIKE 'Handler_commit%';
58
# Expect 0 commit count since nothing
59
# has yet been committed...
61
SHOW STATUS LIKE 'Handler_commit%';
64
DROP SCHEMA IF EXISTS boundaries;
66
# Expect 1 commit count since above DROP SCHEMA
67
# will implicitly call COMMIT.
69
# When we get transactional DDL, should be 0.
70
SHOW STATUS LIKE 'Handler_commit%';
74
# Expect 1 commit count since
75
# an explicit call to COMMIT was made
76
# even though nothing was changed...
78
SHOW STATUS LIKE 'Handler_commit%';
85
SHOW STATUS LIKE 'Handler_commit%';
88
DROP SCHEMA IF EXISTS boundaries;
90
SHOW STATUS LIKE 'Handler_commit%';
91
CREATE TABLE commit_test (a int);
92
SHOW STATUS LIKE 'Handler_commit%';
93
INSERT into commit_test VALUES (10);
94
SHOW STATUS LIKE 'Handler_commit%';
95
INSERT into commit_test VALUES (10), (20);
96
SHOW STATUS LIKE 'Handler_commit%';
97
INSERT into commit_test VALUES (10);
98
SHOW STATUS LIKE 'Handler_commit%';
102
INSERT into commit_test VALUES (10);
103
SHOW STATUS LIKE 'Handler_commit%';
107
SHOW STATUS LIKE 'Handler_commit%';
110
INSERT into commit_test VALUES (10);
111
SHOW STATUS LIKE 'Handler_commit%';
115
SHOW STATUS LIKE 'Handler_commit%';
119
INSERT into commit_test VALUES (10);
120
SHOW STATUS LIKE 'Handler_commit%';
123
SHOW STATUS LIKE 'Handler_commit%';
126
INSERT into commit_test VALUES (10);
127
INSERT into commit_test VALUES (10);
130
SHOW STATUS LIKE 'Handler_commit%';
132
drop table commit_test;
133
SHOW STATUS LIKE 'Handler_commit%';
134
# Tests a number of things related to transactions:
136
# 1. Interaction of more than one engine in a transaction
137
# 2. Correct commit and rollback behaviour
138
# 3. XA protocol communication and recovery
141
DROP TABLE IF EXISTS t1_trx, t1_non_trx;
146
CREATE TABLE t1_trx (
147
k VARCHAR(10) NOT NULL
148
, v VARCHAR(10) NOT NULL
152
CREATE TEMPORARY TABLE t1_non_trx (
153
k VARCHAR(10) NOT NULL
154
, v VARCHAR(10) NOT NULL
160
INSERT INTO t1_trx VALUES ('key1','value1');
161
INSERT INTO t1_trx VALUES ('key2','value2');
163
INSERT INTO t1_non_trx VALUES ('key1','value1');
164
INSERT INTO t1_non_trx VALUES ('key2','value2');
168
--echo Expected warning about non-trx data changes not being rolled back
170
SELECT * FROM t1_trx;
171
SELECT * FROM t1_non_trx;
175
INSERT INTO t1_trx VALUES ('key1','value1');
176
INSERT INTO t1_trx VALUES ('key2','value2');
178
SELECT t1_trx.k, t1_trx.v
180
INNER JOIN t1_non_trx ON t1_trx.k = t1_non_trx.k;
184
SELECT t1_trx.k, t1_trx.v
186
INNER JOIN t1_non_trx ON t1_trx.k = t1_non_trx.k;
190
DROP TABLE t1_non_trx;