From 46484b4e118c4f508e865f0bdd3f966fed494f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 8 Feb 2019 14:15:34 +0200 Subject: [PATCH] MXS-2311: Write queued packet one at a time If an ignorable packet was followed by more than one queued packets, they would all get routed in the same batch. This would cause unexpected replies from the server if multiple ignorable packets were queued up. --- server/modules/protocol/MySQL/mariadbbackend/mysql_backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.c b/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.c index 2e3dfdf93..534fe9212 100644 --- a/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.c +++ b/server/modules/protocol/MySQL/mariadbbackend/mysql_backend.c @@ -877,7 +877,7 @@ gw_read_and_write(DCB *dcb) if (proto->ignore_replies > 0) { /** The reply to a COM_CHANGE_USER is in packet */ - GWBUF *query = proto->stored_query; + GWBUF* query = modutil_get_next_MySQL_packet(&proto->stored_query); proto->stored_query = NULL; proto->ignore_replies--; ss_dassert(proto->ignore_replies >= 0);