File: MDEV-20225.test

package info (click to toggle)
mariadb-10.3 1%3A10.3.34-0%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 531,600 kB
  • sloc: cpp: 1,415,326; ansic: 917,243; perl: 58,570; sh: 43,538; pascal: 39,206; java: 33,919; yacc: 32,096; javascript: 15,655; python: 10,576; ruby: 8,684; xml: 5,957; makefile: 4,893; sql: 3,750; asm: 841; lex: 670; php: 22; awk: 20; sed: 16
file content (52 lines) | stat: -rw-r--r-- 1,613 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#
# MDEV-20225 - Verify that DROP TRIGGER gets keys assigned corresponding
#              to all affected tables.
#

--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
--source suite/galera/include/galera_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

--connection node_2
SET GLOBAL debug_dbug = 'RESET';
SET DEBUG_SYNC = 'now SIGNAL signal.mdev_20225_continue';
SET DEBUG_SYNC = 'RESET';
SET GLOBAL wsrep_slave_threads = 1;

--let $wait_condition = SELECT COUNT(*) = 1 FROM test.t1;
--source include/wait_condition.inc

# Trigger should now be dropped on node_2.
SHOW TRIGGERS;

DROP TABLE t1;
DROP TABLE t2;