8739 Commits

Author SHA1 Message Date
Markus Mäkelä
8fd8c30cd0 Add support for KILL [HARD|SOFT]
The keywords HARD and SOFT are now ignored.
2017-09-27 20:35:34 +03:00
Markus Mäkelä
39c19e1bb9 Fix memory leak on loading of users
If the new format users are loaded, the loaded JSON object was never
freed.
2017-09-27 19:26:05 +03:00
Markus Mäkelä
3922f7a901 Enable tee filter tests for 2.2
Enabled the tests that were accidentally disabled and cleaned up some of
the redundant code in bug649.
2017-09-27 19:26:05 +03:00
Markus Mäkelä
f20005dddc Add missing parameters to alter monitor
The `script_timeout` and `journal_max_age` parameters weren't handled in
the monitor alteration code.

Also added missing documentation to maxadmin help output for
`alter monitor`.
2017-09-27 19:26:05 +03:00
Johan Wikman
7b6680b8fa Merge branch '2.1' into 2.2 2017-09-27 13:04:14 +03:00
Johan Wikman
e97f26f170 Add MaxScale 2.1.10 release notes
Update change log and upgrading as well.
2017-09-27 12:59:20 +03:00
Johan Wikman
23fb0bf928 MXS-1449 Firewall: Allow 'USE <db>'
When the database firewall filter is used in white-list mode,
'USE <db>' should be allowed. When connecting, it is always
possible to specify the database anyway so restricting
'USE <db>' serves no purpose.
2017-09-27 12:59:20 +03:00
Johan Wikman
c1a7008479 MXS-1449 Sort case statements
Faster to later check for something specific.
2017-09-27 12:59:20 +03:00
Markus Mäkelä
f06c34f66c MXS-1456: Fix crash on empty script value
If a script variable resolves to an empty string, the replacement attempt
will fail with an out-of-memory error. The following realloc call will
fail as it requires a positive value for the new size.
2017-09-27 10:32:26 +03:00
Markus Mäkelä
2633ad2fe4 Merge branch '2.1' into 2.2 2017-09-26 14:29:14 +03:00
Markus Mäkelä
118da6c645 Add missing configuration documentation
The admin_log_auth_failures parameter was not documented.
2017-09-26 14:16:45 +03:00
Johan Wikman
df4f3cb302 MXS-1450 Remove leading whitespace
Leading whitespace is removed from a sent maxadmin command
before the command is interpreted.
2017-09-26 13:47:08 +03:00
Johan Wikman
bfe387b73f MXS-1450 Remove manual history, sort includes
Remove manually maintained revision history and sort include
files.
2017-09-26 13:43:59 +03:00
Johan Wikman
4220e3ca6a MXS-1450 Add more string trimming functions
- trim_leading
- trim_trailing

Implemented trim in terms of trim_leading and trim_trailing
2017-09-26 13:36:10 +03:00
Johan Wikman
bb95074e88 MXS-1450 Add test case for trim 2017-09-26 13:19:09 +03:00
Johan Wikman
e0dcb2da38 Update version number 2017-09-26 10:44:19 +03:00
Markus Mäkelä
753c61997d MXS-1451: Expand test case
The test now checks that both users with passwords and users without
passwords work through MaxScale when skip_authentication is enabled. In
addition to this, the test also makes sure that the wrong password and a
missing password are properly detected.
2017-09-26 07:48:45 +03:00
Markus Mäkelä
2079bba49c MXS-1451: Calculate password even with skip_authentication=true
The result of the authentication should be ignored but the scramble that
is calculated as a side-effect still needs to be stored. This can be done
by altering the SQL used to get the matching row to only match on the
username, not the network address.

Also expanded the test case to cover the use of bad credentials.
2017-09-25 19:00:44 +03:00
Johan Wikman
8ef8343f5c MXS-1391 Parse CREATE OR REPLACE 2017-09-25 14:24:42 +03:00
Johan Wikman
621b66ab13 Thread initialization added
Also the main thread must now explicitly be initialized.
2017-09-25 14:04:03 +03:00
Markus Mäkelä
6601f15ff8 MXS-1451: Add test case
Added test case for MXS-1451 that reproduces the problem.
2017-09-25 13:27:55 +03:00
Markus Mäkelä
551bfb6f26 Merge branch '2.1' into 2.2 2017-09-25 12:35:11 +03:00
Johan Wikman
f5b329a0a3 Update 2.1.9 release date 2017-09-25 12:05:40 +03:00
Markus Mäkelä
61f3ba3efa Update 2.2.0 release notes
Added binlogrouter changes to release notes.
2017-09-25 10:52:08 +03:00
Markus Mäkelä
25f9cc14b4 Update avrorouter and the related tutorial
The avrorouter now uses the parameters from the source service. This
removes the need for redundant parameter definition in the avrorouter
service when they are defined in the binlogrouter service as parameters.

Added some missing configuration sanity checks and updated the tutorial to
reflect the new configuration method introduced in 2.1.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
45b78a795e Update binlogrouter defaults
The documentation stated that the binlogrouter would use the cache
directory to store the binary log files. In reality, there was no default
value and the service would fail to start without a binlogdir parameter.

The router now uses the data directory (/var/lib/maxscale/) to store the
binary logs.

Set the default value of mariadb10-compatibility to true. This is in line
with the fact that most installations should use the router with a MariaDB
10.0 server or newer.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
18b0d3575e Speed up binlog tests
The binlogrouter tests can safely use the sync_slaves functionality of the
test framework as long as a sensible timeout is used.

Cleaned up the tests by removing redundant code and allocating classes
from the stack thus removing the need to handle memory allocation.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
944a5bd9c1 Only extract successful PS responses
If a prepared statement fails to execute on a backend server, no prepared
statement ID is returned. As the connection to the slave backend will be
closed when the result of a session command differs from the master's
response, there's no need to even attempt extracting the response.

This change avoids the triggering of a false positive in
mxs_mysql_extract_ps_response when an attempt to extract a
COM_STMT_PREPARE response is made on a response that isn't a
COM_STMT_PREPARE response.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
9f31b746a0 Create rules directory in mxs1110_16mb
The test uses the dbfwfilter but it does not create the directory where
the rules are stored.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
7082edc4ed Also extract SQL from COM_STMT_PREPARE
COM_STMT_PREPARE contains the plain-text prepared statement so it can be
extracted as if it were a COM_QUERY command.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
2d590308b6 Set current command when executing queued queries
When readwritesplit is routing any queued queries, the currently executed
command of the protocol modules needs to be adjusted by
readwritesplit. This is not a true fix but more of a workaround to fix the
problems of queued query execution.

The correct solution would be to move the queued query handling into the
client protocol module so that all components see the same state.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
bfeaceb070 Assert that only complete COM_STMT_PREPARE responses are returned
Asserting that only a complete COM_STMT_PREPARE is returned when the
prepared statement preparation is extracted will guarantee that the
protocol works as expected.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
30f92ebb4b Only pre-process the current statement
If a statement is about to be queued, there's no need to fully parse it
when it will be done again once the current command being executed
finishes.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
14920fef6c Enable info log for mxs1110_16mb
The info log should help resolve why MaxScale crashes with a debug
assertion.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
b1859cc7a5 Speed up lots_of_rows
The test inserted 200k rows with autocommit enabled which made it very
slow. Wrapping the inserts inside a transaction gives the test a
significant speed boost.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
54f4c6ff73 Clean up binlog_semisync
Removed unnecessary newlines and for loops that were executed only once.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
ba47d80efa Only test edge cases in different_size tests
The tests should only test the cases when the payload size changes the
number of packets the query generates. This involves generating only one
packet, one full packet and one partial packet and one full packet and one
empty packet. These cases should cover all reasonable edge cases and
further testing doesn't seem to provide any significant benefit.
2017-09-25 10:46:55 +03:00
Markus Mäkelä
fbc1a7d44b Fix handling of multi-packet queries in readwritesplit
If a prepared statement sends large amounts of data, the target server
where the data is sent will be tracked. The tracked target was not reset
after a multi-packet query was completed and the target itself was used to
check whether the session was processing a multi-packet query.

Changed the check to use the boolean variable instead of the target and
added a reset of the tracked target after a multi-packet query was
completed.
2017-09-25 10:46:44 +03:00
MassimilianoPinto
845b59ad48 Fix buffer size for testbinlog.c
Fix buffer size for testbinlog.c
2017-09-21 11:01:55 +02:00
Johan Wikman
8d136d7979 Scripts work without . in the PATH
Scripts work without . in the path and also if invoked from anywhere.
2017-09-21 10:13:12 +03:00
Johan Wikman
c015adfe92 Update 2.1 release notes 2017-09-21 10:08:50 +03:00
Markus Mäkelä
db7e2c2ffb Use /usr/bin/env perl instead of /bin/perl
This allows Perl to be installed in other locations.
2017-09-21 09:51:58 +03:00
Markus Mäkelä
eb0f8ef25d Drop unused databases
The test code should drop any databases that it creates. Also fixed the
typo in the database name.
2017-09-21 09:42:38 +03:00
Markus Mäkelä
595827f9f0 Clean up pers_01 test
The test used an unnecessary timeout in places where one is not
expected. It also restarted MaxScale with no apparent reason.
2017-09-21 09:36:50 +03:00
Markus Mäkelä
cda1fdc26a Refactor fwf_syntax
Use stack allocated classes, check return value of the start command and
combine the rule creation function.
2017-09-21 09:36:50 +03:00
Markus Mäkelä
049eb68254 Combine redundant dbfwfilter tests
The fwf test now only tests the functionality of the rules themselves, not
the parsing. The fwf_syntax test handles the testing of the parser. The
fwf2 test was removed as it was almost identical with the original fwf
test.
2017-09-21 09:36:50 +03:00
Markus Mäkelä
773bae1615 Speed up testing
Removed unnecessary sleeps from tests that appear to serve no
purpose. Moveed the kerberos code from the general startup routines to the
kerberos test.
2017-09-21 09:36:50 +03:00
Markus Mäkelä
20bfe16d11 Remove unnecessary sleeps
Every time MaxScale was restarted, the test waited for a total of 25
seconds. As MaxScale should start before the command returns, the sleep is
not necessary.

Added StartLimitBurst=0 to the systemd service file to allow rapid
restarts of MaxScale.
2017-09-21 09:36:50 +03:00
Markus Mäkelä
eb3a9667fc Discard connections on interrupted COM_CHANGE_USER
Close the connection if a COM_QUIT is received while the COM_CHANGE_USER
is in progress.
2017-09-21 09:25:56 +03:00
Markus Mäkelä
b2d53a963a Fix the bug listing script
The script had the Markdown links in the wrong order.
2017-09-21 09:25:32 +03:00