MXS-1826: Fix COM_CHANGE_USER regression

The re-authentication done in MaxScale caused multiple error packets to be
sent for the same COM_CHANGE_USER. In addition to this, the failure of
authentication did not terminate the client connection.

The change in behavior requires the test case to be changed as well.
This commit is contained in:
Markus Mäkelä
2018-05-08 15:10:19 +03:00
parent 5eb6718b75
commit 00581e7f35
3 changed files with 61 additions and 11 deletions

View File

@ -859,6 +859,14 @@ gw_read_and_write(DCB *dcb)
}
else
{
/**
* The client protocol always requests an authentication method
* switch to the same plugin to be compatible with most connectors.
*
* To prevent packet sequence number mismatch, always return a sequence
* of 3 for the final response to a COM_CHANGE_USER.
*/
GWBUF_DATA(read_buffer)[3] = 0x3;
proto->changing_user = false;
}
}