mariadb/mysql-test/suite/galera/t/galera_mdev_10812.test
Sachin Setiya 41997d148d MDEV-10812 WSREP causes responses being sent to protocol commands
that must not send a response

Problem:- When using wsrep (w/ galera) and issuing commands that can
cause deadlocks, deadlock exception errors are sent in responses to
commands such as close prepared statement and close connection which,
by spec, must not send a response.

Solution:- In dispatch_command, we will handle COM_QUIT and COM_STMT_CLOSE
commands even in case of error.

Patch Credit:- Jaka Močnik
2017-01-31 13:34:49 +05:30

27 lines
652 B
Text

--source include/galera_cluster.inc
--source include/have_innodb.inc
--echo #
--echo # MDEV-10812: On COM_STMT_CLOSE/COM_QUIT, when wsrep_conflict_state
--echo # is ABORTED, it causes wrong response to be sent to the client
--echo #
# First create a deadlock
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
CREATE TABLE t1(a INT PRIMARY KEY);
INSERT INTO t1 VALUES(1),(2),(3);
START TRANSACTION ;
UPDATE t1 SET a=a+100;
--sleep 2
--connection node_2
UPDATE t1 SET a=a+100;
--sleep 2
--connection node_1a
# here we get deadlock error
--disconnect node_1a
--connection node_2
DROP TABLE t1;