summaryrefslogtreecommitdiff
path: root/mysql-test/suite/galera/t/galera_var_reject_queries.test
blob: 8b80c04e3bebc6d302cac965e1c8f37a186d34d8 (plain)
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
#
# Test wsrep_reject_queries
#

--source include/galera_cluster.inc
--source include/have_innodb.inc

CREATE TABLE t1 (f1 INTEGER);

--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1

--connection node_1
--error ER_GLOBAL_VARIABLE
SET SESSION wsrep_reject_queries = ALL;

SET GLOBAL wsrep_reject_queries = ALL;

--error ER_UNKNOWN_COM_ERROR
SELECT * FROM t1;

#
# Original behavior was lost connection,
# but since 10.1, we allow controlling connection to remain alive
#
--error 0,2013
SET GLOBAL wsrep_reject_queries = ALL_KILL;

--connection node_1a
--error ER_CONNECTION_KILLED,2013,2006
SELECT * FROM t1;

--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
--error ER_UNKNOWN_COM_ERROR
SELECT * FROM t1;

# Confirm that replication continues

--connection node_2
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
INSERT INTO t1 VALUES (1);

--connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1
SET GLOBAL wsrep_reject_queries = NONE;

SELECT COUNT(*) = 1 FROM t1;

DROP TABLE t1;