blob: 12a8a8f5d64cc0e54c79f7d8331cc617a1d06cc4 (
plain)
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
|
#
# PK that is a BIGINT SIGNED
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t1 (f1 BIGINT SIGNED PRIMARY KEY, f2 VARCHAR(5)) ENGINE=InnoDB;
INSERT INTO t1 VALUES
(-9223372036854775808, 'min'),
(9223372036854775807, 'max')
;
--connection node_2
SELECT * FROM t1;
UPDATE t1 SET f2 = CONCAT(f2, '_');
--connection node_1
SELECT * FROM t1;
#
# Deadlock
#
--connection node_1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f2 = 'foo' WHERE f1 = -9223372036854775808;
--connection node_2
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f2 = 'bar' WHERE f1 = -9223372036854775808;
--connection node_1
COMMIT;
SET AUTOCOMMIT=ON;
--connection node_2
--error ER_LOCK_DEADLOCK
COMMIT;
SET AUTOCOMMIT=ON;
DROP TABLE t1;
|