Debian Codegraph @

mysql-test/suite/rpl/r/rpl_temporary_error2.result

raw
1 include/master-slave.inc
2 [connection master]
3 call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction");
4 *** Provoke a deadlock on the slave, check that transaction retry succeeds. ***
5 connection master;
6 CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
7 CREATE TABLE t2 (a INT) ENGINE=InnoDB;
8 INSERT INTO t1(a) VALUES (1), (2), (3), (4), (5);
9 connection slave;
10 SELECT * FROM t1 ORDER BY a;
11 a b
12 1 NULL
13 2 NULL
14 3 NULL
15 4 NULL
16 5 NULL
17 SET sql_log_bin=0;
18 ALTER TABLE t2 ENGINE=MyISAM;
19 SET sql_log_bin=1;
20 connect con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
21 connection con_temp1;
22 BEGIN;
23 UPDATE t1 SET b=2 WHERE a=4;
24 INSERT INTO t2 VALUES (2);
25 DELETE FROM t2 WHERE a=2;
26 connection master;
27 BEGIN;
28 UPDATE t1 SET b=1 WHERE a=2;
29 INSERT INTO t2 VALUES (1);
30 UPDATE t1 SET b=1 WHERE a=4;
31 COMMIT;
32 connection slave;
33 connection con_temp1;
34 UPDATE t1 SET b=2 WHERE a=2;
35 SELECT * FROM t1 WHERE a<10 ORDER BY a;
36 a b
37 1 NULL
38 2 2
39 3 NULL
40 4 2
41 5 NULL
42 ROLLBACK;
43 Warnings:
44 Warning 1196 Some non-transactional changed tables couldn't be rolled back
45 connection slave;
46 SELECT * FROM t1 ORDER BY a;
47 a b
48 1 NULL
49 2 1
50 3 NULL
51 4 1
52 5 NULL
53 * There will be two rows in t2 due to the retry.
54 SELECT * FROM t2 ORDER BY a;
55 a
56 1
57 1
58 retries
59 1
60 Last_SQL_Errno = '0'
61 Last_SQL_Error = ''
62 connection master;
63 DROP TABLE t1;
64 DROP TABLE t2;
65 include/rpl_end.inc