Skip to content

Commit 84d4ab5

Browse files
philip-galeraJan Lindström
authored andcommitted
refs MW-245: Galera MTR Tests: additional tests for wsrep_reject_queries, wsrep_dirty_reads
1 parent 8f717ed commit 84d4ab5

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
CREATE TABLE t1 (f1 INTEGER);
2+
SET SESSION wsrep_reject_queries = ALL;
3+
ERROR HY000: Variable 'wsrep_reject_queries' is a GLOBAL variable and should be set with SET GLOBAL
4+
SET GLOBAL wsrep_reject_queries = ALL;
5+
SELECT * FROM t1;
6+
ERROR 08S01: WSREP has not yet prepared node for application use
7+
SET GLOBAL wsrep_reject_queries = ALL_KILL;
8+
ERROR HY000: Lost connection to MySQL server during query
9+
SELECT * FROM t1;
10+
ERROR 70100: Connection was killed
11+
SELECT * FROM t1;
12+
ERROR 08S01: WSREP has not yet prepared node for application use
13+
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
14+
VARIABLE_VALUE = 2
15+
1
16+
INSERT INTO t1 VALUES (1);
17+
SET GLOBAL wsrep_reject_queries = NONE;
18+
SELECT COUNT(*) = 1 FROM t1;
19+
COUNT(*) = 1
20+
1
21+
DROP TABLE t1;
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#
2+
# Test wsrep_reject_queries
3+
#
4+
5+
--source include/galera_cluster.inc
6+
--source include/have_innodb.inc
7+
8+
CREATE TABLE t1 (f1 INTEGER);
9+
10+
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
11+
12+
--connection node_1
13+
--error ER_GLOBAL_VARIABLE
14+
SET SESSION wsrep_reject_queries = ALL;
15+
16+
SET GLOBAL wsrep_reject_queries = ALL;
17+
18+
--error ER_UNKNOWN_COM_ERROR
19+
SELECT * FROM t1;
20+
21+
# Lost connection
22+
--error 2013
23+
SET GLOBAL wsrep_reject_queries = ALL_KILL;
24+
25+
--connection node_1a
26+
--error ER_CONNECTION_KILLED
27+
SELECT * FROM t1;
28+
29+
--connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1
30+
--error ER_UNKNOWN_COM_ERROR
31+
SELECT * FROM t1;
32+
33+
# Confirm that replication continues
34+
35+
--connection node_2
36+
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
37+
INSERT INTO t1 VALUES (1);
38+
39+
--connect node_1c, 127.0.0.1, root, , test, $NODE_MYPORT_1
40+
SET GLOBAL wsrep_reject_queries = NONE;
41+
42+
SELECT COUNT(*) = 1 FROM t1;
43+
44+
DROP TABLE t1;

0 commit comments

Comments
 (0)