mariadb/mysql-test/suite/galera/r/galera_fk_conflict.result
Brave Galera Crew 36a2a185fe Galera4
2019-01-23 15:30:00 +04:00

29 lines
651 B
Text

connection node_2;
connection node_1;
CREATE TABLE parent (
id INT PRIMARY KEY,
KEY (id)
) ENGINE=InnoDB;
CREATE TABLE child (
id INT PRIMARY KEY,
parent_id INT,
FOREIGN KEY (parent_id)
REFERENCES parent(id)
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1), (2);
INSERT INTO child VALUES (1,1);
connection node_1;
SET AUTOCOMMIT = OFF;
START TRANSACTION;
DELETE FROM parent WHERE id = 2;
connection node_2;
SET AUTOCOMMIT = OFF;
START TRANSACTION;
INSERT INTO child VALUES (2, 2);
connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE child;
DROP TABLE parent;