MXS-1203: Fix current command tracking with statement routing

When statement based routing was used, it was possible that the current
statement being executed wasn't properly updated. Readwritesplit requires
it to track whether a command will create a response.
This commit is contained in:
Markus Mäkelä
2017-04-02 11:11:43 +03:00
parent 6f468c573e
commit a1c7ee438d
2 changed files with 28 additions and 13 deletions

View File

@ -1399,6 +1399,10 @@ static int route_by_statement(MXS_SESSION* session, uint64_t capabilities, GWBUF
if (packetbuf != NULL)
{
CHK_GWBUF(packetbuf);
MySQLProtocol* proto = session->client_dcb->protocol;
proto->current_command = (mysql_server_cmd_t)GWBUF_DATA(packetbuf)[4];
/**
* This means that buffer includes exactly one MySQL
* statement.