mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 02:46:29 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			53 lines
		
	
	
	
		
			1.7 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			53 lines
		
	
	
	
		
			1.7 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| #
 | |
| # MDEV-20225 - Verify that DROP TRIGGER gets keys assigned corresponding
 | |
| #              to all affected tables.
 | |
| #
 | |
| 
 | |
| --source include/galera_cluster.inc
 | |
| --source include/have_debug.inc
 | |
| --source include/have_debug_sync.inc
 | |
| 
 | |
| CREATE TABLE t1 (f1 INT NOT NULL PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
 | |
| CREATE TABLE t2 (f1 INT NOT NULL PRIMARY KEY AUTO_INCREMENT, f2 INT) ENGINE=InnoDB;
 | |
| 
 | |
| CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (NULL, NEW.f1);
 | |
| 
 | |
| --connection node_2
 | |
| SET SESSION wsrep_sync_wait = 0;
 | |
| SET GLOBAL wsrep_slave_threads = 2;
 | |
| SET GLOBAL debug_dbug = 'd,sync.mdev_20225';
 | |
| 
 | |
| --let $galera_connection_name = node_1a
 | |
| --let $galera_server_number = 1
 | |
| --source include/galera_connect.inc
 | |
| DROP TRIGGER tr1;
 | |
| 
 | |
| --connection node_2
 | |
| --let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: now'
 | |
| --source include/wait_condition.inc
 | |
| 
 | |
| 
 | |
| --connection node_1
 | |
| INSERT INTO t1 VALUES (NULL);
 | |
| # We must rely on sleep here. If the bug is fixed, the second applier
 | |
| # is not allowed to go past apply monitor which would trigger the bug,
 | |
| # so there is no sync point or condition to wait.
 | |
| --sleep 1
 | |
| 
 | |
| --let $galera_connection_name = node_2a
 | |
| --let $galera_server_number = 2
 | |
| --source include/galera_connect.inc
 | |
| --connection node_2a
 | |
| SET GLOBAL debug_dbug = 'RESET';
 | |
| SET DEBUG_SYNC = 'now SIGNAL signal.mdev_20225_continue';
 | |
| SET DEBUG_SYNC = 'RESET';
 | |
| SET GLOBAL wsrep_slave_threads = DEFAULT;
 | |
| 
 | |
| --connection node_2
 | |
| # Trigger should now be dropped on node_2.
 | |
| --let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME like '%tr1'
 | |
| --source include/wait_condition.inc
 | |
| SHOW TRIGGERS;
 | |
| 
 | |
| DROP TABLE t1;
 | |
| DROP TABLE t2;
 | 
