12486 Commits

Author SHA1 Message Date
Johan Wikman
76ac63096c MXS-2396 Add check_user_variables configuration parameter
The masking filter should check for things like

    set @ssn = (SELECT ssn FROM users WHERE id = 1);

so that

    select @ssn;

is not possible.
2019-03-20 15:11:58 +02:00
Markus Mäkelä
0b77c3f05f
MXS-2324: Prevent stack overflow with large results
If a result consists of only OK packets, they would be processed
recursively which most of the time leads to a stack overflow. This can be
prevented by consuming all OK packets in the result in one go.
2019-03-20 10:29:03 +02:00
Johan Wikman
a6f52b008f MXS-2390 Firewall should reject statements prepared from var
Currently no practical way for checking what the statement
actually does and thus blanket rejection is the only alternative.
2019-03-19 15:53:46 +02:00
Johan Wikman
09d9570c7e MXS-2392 MXS-2390 Add new test cases
Checks that prepared statements are checked.
2019-03-19 13:09:16 +02:00
Johan Wikman
8e0ee34a94 MXS-2392 MXS-2390 Handle prepared statements in masking filter
- Check textual prepared statements for use of columns to be masked
  in conjunction with functions.
- Check binary prepared statements for use of columns to be masked
  in conjunction with functions.
- Prevent creation of textual prepared statement from variable.
2019-03-19 12:31:08 +02:00
Johan Wikman
7f1c44cf62 MXS-2393 Reject statement that cannot be parsed completely
As the masking filter must reject statements that use columns to be
masked as arguments to functions, a statement that cannot be fully
parsed must be rejected. Unless a statement can be fully parsed we
cannot know whether such usage occurs.
2019-03-19 10:47:37 +02:00
Johan Wikman
c393d633fe MXS-2394 Accept substitute_variables
'substitute_variables' was not listed amongst the symbols that
are pre-parsed, which meant that it was always rejected.
2019-03-19 09:35:18 +02:00
Markus Mäkelä
805e7975f5
Fix log truncation
Syslog wasn't truncated which caused massive disk space usage when the
full test set was run. Also removed the creation of empty log files if no
messages were logged during the run.
2019-03-18 13:58:04 +02:00
Markus Mäkelä
85c2d3c9ee
MXS-2374: Set next_pos for skipped events
By always setting the position of the next event, the replication cannot
break if the slave server has to reconnect after receiving an event that
was generated by the binlogfilter.
2019-03-18 13:58:04 +02:00
Markus Mäkelä
17245c4ce3
Fix false debug assertion
Given the following query:

PREPARE ps FROM 'PREPARE ps2 FROM \'SELECT 1\'';

The debug assertion is hit even though this is valid, albeit unsupported,
SQL. An optimization would be to ignore the query if the prepared
statement type is another prepared statement.
2019-03-18 12:17:48 +02:00
Markus Mäkelä
dd99cadfd2
Prevent unintended sharing of parsing info
When a single GWBUF was split into two with gwbuf_split, the new GWBUF
would point to the start of the shared data and the old one to the
end. Data-wise, this is fine but as the parsing info for queries is stored
in the shared buffer it causes problems when multiple packets get read in
one network payload. The end result would be that only the first query in
the lot would get parsed and the rest would get the same classification as
the first one.

To properly fix this without the need to deep clone the buffer would
require a reorganization of the buffer mechanism in MaxScale.

This commit alone doesn't fix the queued query routing problems in
readwritesplit. The commit from 2.2 which fixes the ordering problems with
queued queries is also required for a fully functional queued query
mechanism.
2019-03-18 12:17:48 +02:00
Markus Mäkelä
4dda31ffe3
Merge branch '2.2' into 2.3 2019-03-16 09:30:56 +02:00
Markus Mäkelä
fd21bed5aa
Fix queued query handling
If a routing of a queued query caused it to be put back on the query
queue, the order in which the queue was reorganized was wrong. The first
query would get appended as the last query which caused the order to be
reversed.
2019-03-15 20:35:17 +02:00
Esa Korhonen
a3af8ffdd0 MXS-2325 Add test case
Tests that a disabled event is not enabled.
2019-03-15 15:36:41 +02:00
Markus Mäkelä
14890cb232
Merge branch '2.2' into 2.3 2019-03-15 12:26:59 +02:00
Markus Mäkelä
4697128b3c
Update 2.2 maintenance version 2019-03-15 11:42:41 +02:00
Markus Mäkelä
4400876b46
Update release date 2019-03-15 11:41:13 +02:00
Markus Mäkelä
29b8d12be3
Always ignore EPIPE errors
There's no reason to not ignore EPIPE errors in debug builds.
2019-03-14 20:08:13 +02:00
Markus Mäkelä
f9853431ee
Simplify maxrows test config
The configuration now uses only one server to prevent replication lag from
affecting the results.
2019-03-14 12:22:25 +02:00
Markus Mäkelä
09dc92973e
Discard connections as the last step
Th discarding of connections in maintenance mode must be done after any
results have been written to them. This prevents closing of the connection
before the actual result is returned.
2019-03-14 12:15:30 +02:00
Markus Mäkelä
e5edb5c78f
Fix reads into bad memory in readwritesplit
The candidate selection code used default values that would cause reads
past buffers. The code could also dereference the end iterator which
causes undefined behavior.
2019-03-14 12:15:30 +02:00
Markus Mäkelä
b537176248
Fix parsing of non-query packets
Packets that do not contain SQL should not be parsed.
2019-03-13 15:44:02 +02:00
Markus Mäkelä
e83555f126
Update release documentation
The update to VERSIONxx.cmake was not documented.
2019-03-13 14:09:00 +02:00
Markus Mäkelä
0df7228e5e
Add 2.2.20 release notes 2019-03-13 13:57:16 +02:00
Markus Mäkelä
e2ac52826a
MXS-2375: Provide aliases for [start|stop] maxscale
The `start services` and `stop services` command aliases now map to the
same command as `start maxscale` and `stop maxscale`. This should help
alleviate the confusion that the command naming caused.
2019-03-13 13:40:37 +02:00
Timofey Turenko
84e456eee2 ignore truncate() return in fwf_syntax test 2019-03-13 12:53:12 +02:00
Esa Korhonen
040562f718 MXS-2342 Run MariaDBMonitor diagnostics concurrent with the monitor loop
This fixes some situations where MaxAdmin/MaxCtrl would block and wait
until a monitor operation or tick is complete. This also fixes a deadlock
caused by calling monitor diagnostics inside a monitor script.

Concurrency is enabled by adding one mutex per server object to protect
array-like fields from concurrent reading/writing.
2019-03-12 10:50:16 +02:00
Esa Korhonen
b4c5500fa1 MXS-2362 Document SchemaRouter table-sharding limitations 2019-03-11 17:39:07 +02:00
Esa Korhonen
c8078c99e5 MXS-2325 Fix Debian 8 compilation 2019-03-11 14:39:02 +02:00
Esa Korhonen
50f588db3e MXS-2370 Clarify query timeout warning message
The message now more clearly states if the failure was due to timeout or
a different Connector-C error.
2019-03-11 13:20:50 +02:00
Esa Korhonen
f76ae381c0 MXS-2325 Update documentation with the new behavior 2019-03-11 13:07:53 +02:00
Markus Mäkelä
3081bfbb1e
Merge branch '2.2' into 2.3 2019-03-11 10:49:06 +02:00
Markus Mäkelä
c132125d55
Fix log truncation
Syslog wasn't truncated which caused massive disk space usage when the
full test set was run.
2019-03-11 10:47:44 +02:00
Markus Mäkelä
160b4e6e05
MXS-2368: Fix reading of non-tty input
The password input only worked if stdin was a TTY. This was caused by the
fact that the readline-sync library only worked for TTYs.
2019-03-11 10:47:43 +02:00
Markus Mäkelä
710e5df27b
MXS-2365: Fix classification of queued queries
Queries in the query queue need to be explicitly parsed since they are
stored in a single buffer and thus share the query classification
information. In the next major version this should be changed into an
array of individual buffers instead of a shared buffer.
2019-03-08 14:45:18 +02:00
Markus Mäkelä
5c5c6630bf
Fix retain_last_statements
If multiple statements were stored in a single buffer only one of them
would get registered.
2019-03-08 14:45:18 +02:00
Markus Mäkelä
7f27db02a8
Fix global retain_last_statements
The default value was wrong.
2019-03-08 14:45:18 +02:00
Timofey Turenko
444c120101 Merge branch '2.3' of github.com:mariadb-corporation/MaxScale into 2.3 2019-03-08 13:55:07 +02:00
Markus Mäkelä
247e558ffa
Fix tls-model exposure to other modules
The flag was propagated to other modules that depend on it.
2019-03-08 12:10:31 +02:00
Markus Mäkelä
5005facfb1
Always dump the full configuration
Always storing runtime configuration changes prevents problems when the
change causes another parameter to change. One example of this is
transaction_replay that implicitly enables other parameters.
2019-03-08 12:10:31 +02:00
Markus Mäkelä
7db87784ac
Deliver hangups only to valid DCBs
If a DCB was closed and a hangup event was sent to it via
dcb_hangup_foreach shortly after it was closed, the DCB would still
receive it even if it was closed. To prevent this, events must only be
delivered to DCBs if they haven't been closed.
2019-03-08 12:10:30 +02:00
Markus Mäkelä
71a3cde441
MXS-2373: Fix filter serialization
The module of a filter was ignored as it wasn't in the list of expected
module parameters.
2019-03-08 12:10:30 +02:00
Timofey Turenko
c83868936a fix start_maxscale for valgrind case 2019-03-08 11:47:11 +02:00
Markus Mäkelä
267ec9cccc
Fix filter serialization
Filters were serialized with commas as separators instead of pipes.
2019-03-07 16:02:49 +02:00
Markus Mäkelä
48d2f3bd84
Correct REST-API-Tutorial 2019-03-07 15:59:27 +02:00
Markus Mäkelä
5b43940559
Track session state only when required
The protocol should not track the session state as the parsing is quite
expensive with the current code. This change is a workaround that enables
the parsing only when required. A proper way to handle this would be to do
all the response processing in one place thus avoiding the duplication of
work.
2019-03-07 15:59:26 +02:00
Markus Mäkelä
b97976c4ee
MXS-2323: Close stale connections
Cleaning up and closing stale connections to servers in maintenance mode
helps administrators see when a server is no longer in use.
2019-03-07 15:59:26 +02:00
Markus Mäkelä
a7be3c527c
Remove unnecessary memory allocations
Given the fact that there exist only three possible categories, the map
can be replaced with a static array that needs no memory
allocations. Making this array thread-local allows it to be reused which
places an upper limit on the number of memory allocations.
2019-03-07 15:59:26 +02:00
Esa Korhonen
e7f739e95d MXS-2337 Fix sharding test
There is now enought time between queries that the shard map is reconstructed.
2019-03-07 13:07:20 +02:00
Esa Korhonen
4208dff2e6 MXS-2337 Schemarouter responds correctly to SHOW TABLES
The router now handles the query similarly to a "SHOW TABLES FROM X"
with the current db assigned to X.
2019-03-07 13:07:20 +02:00