Debian Codegraph @

mysql-test/suite/galera/t/mysql-wsrep#198.test

raw
1 --source include/galera_cluster.inc
2 --source include/have_innodb.inc
3
4 CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
5 CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
6
7 --connection node_2
8 # Ensure that the tables have been created on node #2
9 SELECT 1 FROM DUAL;
10
11 LOCK TABLE t2 WRITE;
12
13 --connect node_2_ctrl, 127.0.0.1, root, , test, $NODE_MYPORT_2
14 --connection node_2_ctrl
15 SET SESSION wsrep_sync_wait=0;
16
17 --connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
18 --connection node_2a
19 --send OPTIMIZE TABLE t1,t2;
20
21 --connection node_2_ctrl
22 SET SESSION wsrep_sync_wait = 0;
23 --let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'acquiring total order isolation%' OR STATE LIKE 'Waiting to execute in isolation%';
24 --let $wait_condition_on_error_output = SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
25 --source include/wait_condition_with_debug_and_kill.inc
26
27 --connect node_2b, 127.0.0.1, root, , test, $NODE_MYPORT_2
28 --connection node_2b
29 --send REPAIR TABLE t1,t2;
30
31 --connection node_2_ctrl
32 --let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'Waiting for table metadata lock%' OR STATE LIKE 'acquiring total order isolation%' OR STATE LIKE 'Waiting to execute in isolation%';
33 --let $wait_condition_on_error_output = SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST
34 --source include/wait_condition_with_debug_and_kill.inc
35
36 --connection node_1
37 # We have LOCK TABLE in node_2 so this could fail on lock wait
38 # or next statement is fast enought and succeed
39 --error 0,ER_LOCK_WAIT_TIMEOUT
40 INSERT INTO t2 VALUES (1);
41
42 --connection node_2
43 UNLOCK TABLES;
44
45 --connection node_2a
46 --reap
47
48 --connection node_2b
49 --reap
50
51 DROP TABLE t1;
52 DROP TABLE t2;
53
54 --connection node_1
55
56 --disconnect node_2a
57 --disconnect node_2b
58 --disconnect node_2_ctrl