4
-- source include/have_innodb.inc
6
# Save the initial number of concurrent sessions
7
--source include/count_sessions.inc
10
drop table if exists t1, t2;
12
create table t1 (a int) engine=innodb;
14
insert t1 values (10);
21
--error ER_XAER_RMFAIL
23
insert t1 values (20);
24
--error ER_XAER_RMFAIL
31
xa start 'testa','testb';
32
insert t1 values (30);
34
--error ER_XAER_RMFAIL
37
xa end 'testa','testb';
39
--error ER_XAER_RMFAIL
41
--error ER_XAER_RMFAIL
42
create table t2 (a int);
44
connect (con1,localhost,root,,);
48
xa start 'testa','testb';
50
xa start 'testa','testb', 123;
52
# gtrid [ , bqual [ , formatID ] ]
53
xa start 0x7465737462, 0x2030405060, 0xb;
54
insert t1 values (40);
55
xa end 'testb',' 0@P`',11;
56
xa prepare 'testb',0x2030405060,11;
58
--error ER_XAER_RMFAIL
63
# uncomment the line below when binlog will be able to prepare
67
xa prepare 'testa','testb';
72
xa commit 'testb',0x2030405060,11;
73
xa rollback 'testa','testb';
75
--error ER_PARSE_ERROR
76
xa start 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz';
84
# Bug#28323: Server crashed in xid cache operations
88
drop table if exists t1;
91
create table t1(a int, b int, c varchar(20), primary key(a)) engine = innodb;
92
insert into t1 values(1, 1, 'a');
93
insert into t1 values(2, 2, 'b');
95
connect (con1,localhost,root,,);
96
connect (con2,localhost,root,,);
100
update t1 set c = 'aa' where a = 1;
103
update t1 set c = 'bb' where a = 2;
105
--send update t1 set c = 'bb' where a = 2
108
--error ER_LOCK_DEADLOCK
109
update t1 set c = 'aa' where a = 1;
110
select count(*) from t1;
111
--error ER_XA_RBDEADLOCK
116
connect (con3,localhost,root,,);
125
--echo End of 5.0 tests
128
# Bug#44672: Assertion failed: thd->transaction.xid_state.xid.is_null()
139
# Bug#45548: XA transaction without access to InnoDB tables crashes the server
153
# BUG#43171 - Assertion failed: thd->transaction.xid_state.xid.is_null()
155
CREATE TABLE t1(a INT, KEY(a)) ENGINE=InnoDB;
156
INSERT INTO t1 VALUES(1),(2);
157
connect(con1,localhost,root,,);
159
# Part 1: Prepare to test XA START after regular transaction deadlock
161
UPDATE t1 SET a=3 WHERE a=1;
165
UPDATE t1 SET a=4 WHERE a=2;
168
let $conn_id= `SELECT CONNECTION_ID()`;
169
SEND UPDATE t1 SET a=5 WHERE a=2;
172
let $wait_timeout= 2;
173
let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
174
WHERE ID=$conn_id AND STATE='Searching rows for update';
175
--source include/wait_condition.inc
177
--error ER_LOCK_DEADLOCK
178
UPDATE t1 SET a=5 WHERE a=1;
181
# Part 2: Prepare to test XA START after XA transaction deadlock
186
UPDATE t1 SET a=3 WHERE a=1;
190
UPDATE t1 SET a=4 WHERE a=2;
193
SEND UPDATE t1 SET a=5 WHERE a=2;
196
let $wait_timeout= 2;
197
let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
198
WHERE ID=$conn_id AND STATE='Searching rows for update';
199
--source include/wait_condition.inc
201
--error ER_LOCK_DEADLOCK
202
UPDATE t1 SET a=5 WHERE a=1;
203
--error ER_XA_RBDEADLOCK
214
# Wait till all disconnects are completed
215
--source include/wait_until_count_sessions.inc