blob: bb7e22014d97a6b3e6071bccaec860b1f4dc176c (
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
47
48
49
50
51
52
53
54
55
56
57
|
connection node_2;
connection node_1;
#
# MDEV#5552 Deadlock when inserting NULL column value in column with
# UNIQUE index
#
USE test;
# On node_1
connection node_1;
CREATE TABLE t1(c1 INT DEFAULT NULL, UNIQUE KEY c1(c1)) ENGINE=INNODB;
INSERT INTO t1 VALUES (NULL);
INSERT INTO t1 VALUES (NULL);
SELECT * FROM test.t1;
c1
NULL
NULL
# On node_2
connection node_2;
SELECT * FROM test.t1;
c1
NULL
NULL
# On node_1
connection node_1;
INSERT INTO t1 VALUES (1);
UPDATE t1 SET c1=NULL WHERE c1=1;
SELECT * FROM test.t1;
c1
NULL
NULL
NULL
# On node_2
connection node_2;
SELECT * FROM test.t1;
c1
NULL
NULL
NULL
# On node_1
connection node_1;
DELETE FROM t1 WHERE c1<=>NULL;
SELECT * FROM test.t1;
c1
# On node_2
connection node_2;
SELECT * FROM test.t1;
c1
DROP TABLE t1;
disconnect node_2;
disconnect node_1;
# End of test
|