--connect (conn1,127.0.0.1,root,,test,$MYPORT_1) --connect (conn2,127.0.0.1,root,,test,$MYPORT_1) --connection conn1 CREATE TABLE t (i INT) ENGINE = InnoDB; INSERT INTO t (i) VALUES(1); xa start '1'; SELECT * FROM t WHERE i = 1 LOCK IN SHARE MODE; --connection conn2 xa start '2'; --send update t set i=2 where i=1; --sleep 1 --connection conn1 update t set i=2 where i=1; xa end '1'; xa prepare '1'; xa commit '1'; --connection conn2 --error ER_LOCK_DEADLOCK --reap insert into t values (5); --error ER_XA_RBDEADLOCK xa end '2'; xa rollback '2'; --source include/wait_follower_catchup.inc drop table t;