8753 Commits

Author SHA1 Message Date
Markus Mäkelä
27ccf0877c Fix bug in the cdc_connector
The cdc_connector did not check if the data request was successful.
2017-09-29 21:11:12 +03:00
Markus Mäkelä
b446f442b6 Process data sent before authentication is complete
If the client sends data before authentication is complete, it must not be
discarded and it needs to be processed like as if it was sent in a
separate network packet.
2017-09-29 21:11:08 +03:00
Markus Mäkelä
c6623337b6 Stop monitors first when shutting down
As monitors aren't synchronized with the worker threads, they need to be
shut down first.
2017-09-29 21:11:07 +03:00
Johan Wikman
ae3e7a07e2 Always return json object from module commands
If a module command returns a json object, it will always be
returned to the caller, irrespective of whether the command
itself succeeded or not.

Otherwise, if the command failed and if the module command has
set an error message, that error message will be returned as a
json object containing the error message.
2017-09-29 12:06:17 +03:00
Markus Mäkelä
071d364b0a Fix formatting errors
Fixed the formatting errors introduced by Astyle. Changed the comment
syntax to use a more Astyle-friendly one.
2017-09-28 20:27:07 +03:00
Johan Wikman
9c60b68476 Convert mysql_mon.c to mysql_mon.cc 2017-09-28 15:17:27 +03:00
Markus Mäkelä
14d8b6a0df Remove MODULECMD_ARG_OUTPUT argument type
Since the module command interface was expanded to include a JSON output
parameter, there is no longer a need for an output DCB. As the JSON can be
printed by both maxadmin and the REST API, this allows the removal of
explicit output formatting in module commands.
2017-09-28 13:59:28 +03:00
Markus Mäkelä
da648387dd Handle failed module commands with no error messages
If a module command fails to execute but no error messages are stored, a
generic error message is logged.
2017-09-28 13:53:40 +03:00
Markus Mäkelä
380482d507 Fix memory leak on module command call
If a module command outputted JSON, the string generated by json_dumps
would leak.
2017-09-28 13:11:49 +03:00
Markus Mäkelä
e55968b808 Fix listener creation via REST API
The check for SSL parameters was wrong as it tested whether all SSL
parameters were defined even when the check was not needed.
2017-09-28 13:03:04 +03:00
Markus Mäkelä
f102a563e9 Add explicit usage to each command
The yargs framework combined with the pkg packaging causes the executable
name to be mangled on installation. For this reason, the usage should be
explicitly added to each command.
2017-09-28 12:40:51 +03:00
Markus Mäkelä
c2283bbff1 Remove LocalClient fd from poll set
The file descriptor registered for the LocalClient instances need to be
removed from the worker it was added to when the object is destroyed.
2017-09-28 11:04:02 +03:00
Markus Mäkelä
5b0b1666cc Fix bug649
The `Test` is a pointer.
2017-09-28 10:39:37 +03:00
Markus Mäkelä
895d950da0 Format all source files with Astyle
Formatted all source files Astyle.
2017-09-28 07:04:21 +03:00
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