mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
MDEV#5552 Deadlock when inserting NULL column value
in column with UNIQUE index References: lp:1276424
This commit is contained in:
parent
c3a2394641
commit
689aaab0f8
2 changed files with 101 additions and 0 deletions
47
mysql-test/suite/galera/r/unique_key.result
Normal file
47
mysql-test/suite/galera/r/unique_key.result
Normal file
|
@ -0,0 +1,47 @@
|
|||
#
|
||||
# MDEV#5552 Deadlock when inserting NULL column value in column with
|
||||
# UNIQUE index
|
||||
#
|
||||
USE test;
|
||||
|
||||
# On 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
|
||||
SELECT * FROM test.t1;
|
||||
c1
|
||||
NULL
|
||||
NULL
|
||||
|
||||
# On 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
|
||||
SELECT * FROM test.t1;
|
||||
c1
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
|
||||
# On node_1
|
||||
DELETE FROM t1 WHERE c1<=>NULL;
|
||||
SELECT * FROM test.t1;
|
||||
c1
|
||||
|
||||
# On node_2
|
||||
SELECT * FROM test.t1;
|
||||
c1
|
||||
DROP TABLE t1;
|
||||
# End of test
|
54
mysql-test/suite/galera/t/unique_key.test
Normal file
54
mysql-test/suite/galera/t/unique_key.test
Normal file
|
@ -0,0 +1,54 @@
|
|||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
--echo #
|
||||
--echo # MDEV#5552 Deadlock when inserting NULL column value in column with
|
||||
--echo # UNIQUE index
|
||||
--echo #
|
||||
|
||||
USE test;
|
||||
--echo
|
||||
--echo # 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;
|
||||
|
||||
--echo
|
||||
--echo # On node_2
|
||||
--connection node_2
|
||||
SELECT * FROM test.t1;
|
||||
|
||||
|
||||
--echo
|
||||
--echo # On node_1
|
||||
--connection node_1
|
||||
INSERT INTO t1 VALUES (1);
|
||||
UPDATE t1 SET c1=NULL WHERE c1=1;
|
||||
SELECT * FROM test.t1;
|
||||
|
||||
--echo
|
||||
--echo # On node_2
|
||||
--connection node_2
|
||||
SELECT * FROM test.t1;
|
||||
|
||||
--echo
|
||||
--echo # On node_1
|
||||
--connection node_1
|
||||
DELETE FROM t1 WHERE c1<=>NULL;
|
||||
SELECT * FROM test.t1;
|
||||
|
||||
--echo
|
||||
--echo # On node_2
|
||||
--connection node_2
|
||||
SELECT * FROM test.t1;
|
||||
|
||||
--let $galera_diff_statement = SELECT * FROM t1
|
||||
--source include/galera_diff.inc
|
||||
|
||||
# Cleanup
|
||||
DROP TABLE t1;
|
||||
|
||||
--source include/galera_end.inc
|
||||
--echo # End of test
|
Loading…
Reference in a new issue