Port 9003 is not open by default in the test environment. Changing it to
port 4006, which is open, will work around this restriction.
Also added the mysql_error output to the error message when the querying
fails.
Dropping a database with DROP DATABASE ... IF NOT EXISTS will cause
warnings to be logged if it doesn't exist. The masking_user test was
missing the part that disables these warnings.
Backported the minimal set of changes required to build 2.1 with GCC
8. The format-truncation and format-overflow warnings are disabled instead
of fixed in 2.1 to remove duplication of effort that was already done in
2.2 (the commit doesn't cherry-pick cleanly).
The default database was not extracted correctly as the length of the
user's name did not include the null terminator. Also the comparison for
database name length used the smaller than operator instead of the correct
larger than operator.
When the client reauthenticates via COM_CHANGE_USER the new SHA1 needs to
be stored as the backend connections rely on it being up-to-date.
This commit fixes the regression of the mxs548_short_session_change_user
test.
If the reauthentication of a client that is performing a COM_CHANGE_USER
fails, the users need to be reloaded. Without the reloading, the
reauthentication will fail if new users were added after the last loading
of users.
The parameter extraction caused a recursive lock of the server
spinlock. To work around this, an unlocked version of server_get_parameter
is needed.
Ideally, a lock-free setup would be used but due to this being a bug fix,
it will have to be done later on.
Some of the scripts assumed that other scripts would be located in the
same directory where the current script was executed.
Also fixed the SSL connection creation which depended on an obsolete
environment variable causing all out-of-source SSL tests to fail.
The test can now be run outside of the test source directory. Since the
`test_dir` global variable contains the absolute path to the test source,
all copying of configurations and execution of scripts can be done with
minimal changes.
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.
Multi-statement SELECTs were properly detected and handled,
but e.g. multi-statement UPDATESs were not, with the result
that erronous warnings were logged.
Now the responses are detected and handled properly.
If a connection is killed but the backend DCBs have not yet received their
thread IDs, the connections can be forcibly closed. This removes the
possibility of stale connections caused by an unfortunately timed KILL
query to a session that has partially connected to some servers.
Returning the length of the value instead of a boolean allows the user to
know when the parameter value exceeded the buffer size passed as the
parameter.
To support a wider range of client connectors, MaxScale should respond
with an AuthSwitchRequest packet to all COM_CHANGE_USER commands. Only
MariaDB connectors understand the OK packet as the only response to a
COM_CHANGE_USER but all connectors understand the AuthSwitchRequest
packet.
The mysql_create_standard_error function accepted a packet number as a
parameter but did not use it as the actual packet number. As the value it
used happened to coincide with 50% of the use-cases, it went unnoticed.
The remaining 50% occurred when a KILL command was executed with an
unknown connection ID.