To work around the limitation in the session command handling and
multi-part results, all session commands are now treated as gathered
results. This allows session commands which return result sets to be used
with MaxScale.
This change should not cause problems with practical workloads as they
usually do not return massive resultsets for session commands.
The optimal way to handle the multi-part responses would be to integrate
it into the result completion tracking process. This would allow the
prepared statement IDs to be extracted while the command is being
processed.
The test now flushes the INPUT chain of iptables at the start of the
test. This should open all ports even if the OS by default defines some
rules that block ports.
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.