From e99d9826ad1cb7cb293de1c3929a0dd1db28d779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 12 Jun 2018 11:46:31 +0300 Subject: [PATCH] Fix route_by_statement return value The return value of route_by_statement was not initialized and not set if a COM_CHANGE_USER was processed. --- server/modules/protocol/MySQL/mariadbclient/mysql_client.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc b/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc index 577bf867b..428654b7e 100644 --- a/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc +++ b/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc @@ -1575,7 +1575,7 @@ static bool reauthenticate_client(MXS_SESSION* session, GWBUF* packetbuf) */ static int route_by_statement(MXS_SESSION* session, uint64_t capabilities, GWBUF** p_readbuf) { - int rc; + int rc = 1; GWBUF* packetbuf; do { @@ -1682,6 +1682,7 @@ static int route_by_statement(MXS_SESSION* session, uint64_t capabilities, GWBUF // Store the original COM_CHANGE_USER for later proto->stored_query = packetbuf; packetbuf = NULL; + rc = 1; } else if (proto->changing_user) {