| 1 |
# |
| 2 |
# MDEV-20225 - Verify that DROP TRIGGER gets keys assigned corresponding |
| 3 |
# to all affected tables. |
| 4 |
# |
| 5 |
|
| 6 |
--source include/galera_cluster.inc |
| 7 |
--source include/have_debug.inc |
| 8 |
--source include/have_debug_sync.inc |
| 9 |
|
| 10 |
CREATE TABLE t1 (f1 INT NOT NULL PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; |
| 11 |
CREATE TABLE t2 (f1 INT NOT NULL PRIMARY KEY AUTO_INCREMENT, f2 INT) ENGINE=InnoDB; |
| 12 |
|
| 13 |
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (NULL, NEW.f1); |
| 14 |
|
| 15 |
--connection node_2 |
| 16 |
SET SESSION wsrep_sync_wait = 0; |
| 17 |
SET GLOBAL wsrep_slave_threads = 2; |
| 18 |
SET GLOBAL debug_dbug = 'd,sync.mdev_20225'; |
| 19 |
|
| 20 |
--let $galera_connection_name = node_1a |
| 21 |
--let $galera_server_number = 1 |
| 22 |
--source include/galera_connect.inc |
| 23 |
DROP TRIGGER tr1; |
| 24 |
|
| 25 |
--connection node_2 |
| 26 |
--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: now' |
| 27 |
--source include/wait_condition.inc |
| 28 |
|
| 29 |
|
| 30 |
--connection node_1 |
| 31 |
INSERT INTO t1 VALUES (NULL); |
| 32 |
# We must rely on sleep here. If the bug is fixed, the second applier |
| 33 |
# is not allowed to go past apply monitor which would trigger the bug, |
| 34 |
# so there is no sync point or condition to wait. |
| 35 |
--sleep 1 |
| 36 |
|
| 37 |
--let $galera_connection_name = node_2a |
| 38 |
--let $galera_server_number = 2 |
| 39 |
--source include/galera_connect.inc |
| 40 |
--connection node_2a |
| 41 |
SET GLOBAL debug_dbug = 'RESET'; |
| 42 |
SET DEBUG_SYNC = 'now SIGNAL signal.mdev_20225_continue'; |
| 43 |
SET DEBUG_SYNC = 'RESET'; |
| 44 |
SET GLOBAL wsrep_slave_threads = DEFAULT; |
| 45 |
|
| 46 |
--connection node_2 |
| 47 |
# Trigger should now be dropped on node_2. |
| 48 |
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME like '%tr1' |
| 49 |
--source include/wait_condition.inc |
| 50 |
SHOW TRIGGERS; |
| 51 |
|
| 52 |
DROP TABLE t1; |
| 53 |
DROP TABLE t2; |