From 1e3ab1fc7cb5ece53611a0fc48d0867aeda85c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 6 Apr 2018 17:35:37 +0300 Subject: [PATCH] MXS-1765: Update current command for KILL processing The current command needs to be updated before the queries are actually routed. This allows the KILL command detection and processing to correctly work. --- server/modules/protocol/MySQL/mariadbclient/mysql_client.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc b/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc index aabc618d5..a1c1164b4 100644 --- a/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc +++ b/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc @@ -972,6 +972,10 @@ gw_read_normal_data(DCB *dcb, GWBUF *read_buffer, int nbytes_read) return 0; } + // Update the current command, required by KILL command processing + MySQLProtocol *proto = (MySQLProtocol*)dcb->protocol; + proto->current_command = (mxs_mysql_cmd_t)mxs_mysql_get_command(read_buffer); + set_qc_mode(session, &read_buffer); session_retain_statement(session, read_buffer);