Commit 84d4ab5b authored by Philip Stoev's avatar Philip Stoev Committed by Jan Lindström

refs MW-245: Galera MTR Tests: additional tests for wsrep_reject_queries, wsrep_dirty_reads

parent 8f717ed3
CREATE TABLE t1 (f1 INTEGER);
SET SESSION wsrep_reject_queries = ALL;
ERROR HY000: Variable 'wsrep_reject_queries' is a GLOBAL variable and should be set with SET GLOBAL
SET GLOBAL wsrep_reject_queries = ALL;
SELECT * FROM t1;
ERROR 08S01: WSREP has not yet prepared node for application use
SET GLOBAL wsrep_reject_queries = ALL_KILL;
ERROR HY000: Lost connection to MySQL server during query
SELECT * FROM t1;
ERROR 70100: Connection was killed
SELECT * FROM t1;
ERROR 08S01: WSREP has not yet prepared node for application use
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
INSERT INTO t1 VALUES (1);
SET GLOBAL wsrep_reject_queries = NONE;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
DROP TABLE t1;
#
# 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;
# Lost connection
--error 2013
SET GLOBAL wsrep_reject_queries = ALL_KILL;
--connection node_1a
--error ER_CONNECTION_KILLED
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;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment