mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Note, the fix for "MDEV-23328 Server hang due to Galera lock conflict resolution" was null-merged. 10.4 version of the fix is coming up separately
67 lines
1.7 KiB
Plaintext
67 lines
1.7 KiB
Plaintext
connection node_2;
|
|
connection node_1;
|
|
#
|
|
# test phase with foreign key of varchar type
|
|
#
|
|
connection node_1;
|
|
CREATE TABLE parent (
|
|
`id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
CREATE TABLE child (
|
|
`id` int NOT NULL,
|
|
`parent_id` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `parent_id` (`parent_id`),
|
|
CONSTRAINT `ipallocations_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`) ON DELETE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
|
INSERT INTO parent VALUES ('row one'), ('row two');
|
|
INSERT INTO child VALUES (1,'row one'), (2,'row two');
|
|
connection node_2;
|
|
DELETE FROM parent;
|
|
connection node_1;
|
|
SELECT * FROM parent;
|
|
id
|
|
SELECT * FROM child;
|
|
id parent_id
|
|
DROP TABLE child;
|
|
DROP TABLE parent;
|
|
#
|
|
# test phase with MM conflict in FK cascade
|
|
#
|
|
connection node_1;
|
|
set wsrep_retry_autocommit=0;
|
|
CREATE TABLE parent (
|
|
id INT NOT NULL PRIMARY KEY
|
|
) ENGINE=InnoDB;
|
|
CREATE TABLE child (
|
|
id INT NOT NULL PRIMARY KEY,
|
|
j int default 0,
|
|
parent_id INT,
|
|
FOREIGN KEY (parent_id)
|
|
REFERENCES parent(id)
|
|
ON DELETE CASCADE
|
|
) ENGINE=InnoDB;
|
|
INSERT INTO parent VALUES (1);
|
|
INSERT INTO child VALUES (1,0,1);
|
|
connection node_2;
|
|
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
|
|
SET GLOBAL debug_dbug = "d,sync.wsrep_apply_cb";
|
|
connection node_2;
|
|
DELETE FROM parent;
|
|
connection node_1a;
|
|
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_cb_reached";
|
|
connection node_1;
|
|
update child set j=2;;
|
|
connection node_1a;
|
|
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
|
|
SET GLOBAL debug_dbug = "";
|
|
SET DEBUG_SYNC = "RESET";
|
|
connection node_1;
|
|
SELECT * FROM parent;
|
|
id
|
|
SELECT * FROM child;
|
|
id j parent_id
|
|
DROP TABLE child;
|
|
DROP TABLE parent;
|