Commit Graph

3243 Commits

Author SHA1 Message Date
8c236c1cdc Define ComEOF packet length in terms of MYSQL_EOF_PACKET_LEN 2017-01-19 09:26:37 +02:00
fed61fde98 Disable prepared statement execution in dbfwfilter
The dbfwfilter doesn't parse prepared statements for all rules which
requires that they are disabled.
2017-01-19 08:57:15 +02:00
cfcd1dc38f Maxrows filter uses new constants: MYSQL_EOF_PACKET_LEN and MYSQL_OK_PACKET_MIN_LEN
New constants MYSQL_EOF_PACKET_LEN, MYSQL_OK_PACKET_MIN_LEN are now
used by max rows filter
2017-01-18 15:47:04 +01:00
e4d6af37a9 Masking: Distinguish between EOF and 8 byte integer
When processing the response to a COM_QUERY, the rows will be
terminated by an EOF packet. However, as the type byte of an
EOF packet is 0xFE and the identifying byte of an 8 byte length
encoded integer is also 0xFE it is not possible to distinguish
the two except by also looking at packet length.
2017-01-18 14:31:48 +02:00
00f77bbe69 Fix some leftovers from the SESSION->MXS_SESSION and related renames
Renames only.
2017-01-18 11:50:52 +02:00
fbb63f4eb8 Masking: Handle larger than 16MB payloads
Larger than 16MB payloads can either be ignored or then they may
cause the session to be aborted.
2017-01-18 08:45:51 +02:00
969e423eb2 Masking: Add large_payload parameter
The masking filter will assume payloads less than 2^24 - 1. The
behaviour if payloads larger than than are encountered can be
configured.

The actual implementation follows in a subsequent change.
2017-01-18 08:44:04 +02:00
16a76fcd28 Rename qc_get_type() to qc_get_type_mask()
To make it plain that it is a mask that is returned and not a
specific value from the enum qc_query_type_t.
2017-01-18 08:34:53 +02:00
86c97a2109 Analyze binary prepared statements as well
Now that the query classifier can be given COM_STMT_PREPARE packets
in addition to COM_QUERY packets, binary prepared statements will
be subject to the same analyses as any other statement.
2017-01-18 08:34:53 +02:00
f7892843b5 Handle prepared named statements in firewall filter
Binary prepared statements need to be addressed separately.
2017-01-18 08:34:53 +02:00
5fc7b277da Change SESSION to MXS_SESSION
Some modules didn't use the new MXS_SESSION structure.
2017-01-18 08:31:47 +02:00
19b678abfe MXS-406: check for log message is now fixed
Log message now appears with the right variables check
2017-01-17 16:06:11 +01:00
c62be62618 Add missing galeramon modifications
The changes for MXS-406 were lost when the file was formatted and the
changes were rebased.
2017-01-17 16:57:21 +02:00
fb771c8a2e Rename public types and constants in session.h
Preparing to split session.h into module and core sections.
2017-01-17 16:30:14 +02:00
680401cf8e Rename public types and constants in monitor.h
Preparing to split monitor.h into module and core sections. Also
changed a few comments in monitor.h.
2017-01-17 15:47:13 +02:00
f9440a6b35 Parse only valid packets in dbfwfilter
The filter attempted to parse all packets that were routed through the
filter.
2017-01-17 14:48:43 +02:00
a48be9badf Format router modules
Formatted router modules with Astyle.
2017-01-17 14:48:43 +02:00
735674bb1b Format monitor modules
Formatted monitor modules with Astyle.
2017-01-17 14:48:41 +02:00
c25b7629f4 Format filter modules
Formatted filter modules with Astyle.
2017-01-17 14:47:50 +02:00
4869fd98eb Format authenticator modules
Formatted authenticator modules with Astyle.
2017-01-17 14:47:50 +02:00
1766e3a06b Format protocol modules
Formatted protocol modules with Astyle.
2017-01-17 14:47:50 +02:00
f45ac341d8 MXS-406: node comparison function is now split in two different ones
Two new routines, compare_node_index and compare_node_priority
routines, can be used by qsort depending on sort_order var
2017-01-17 13:18:02 +01:00
23e40dc0f8 MXS-406: slave nodes are sorted before setting 'wsrep_sst_donor'
The slave nodes par od the cluster are sorted by wsrep_local_index or
server priority.

The sorted list od nodes is then used in ‘wsrep_sst_donor’ variable.

Note: candidate master servers are always at the end of the list
2017-01-17 13:18:01 +01:00
5b92a1f467 Remove explicit module name from log messages
The module name doesn't need to be logged as MXS_MODULE_NAME will be
automatically added as a prefix to all messages logged by the module.
2017-01-17 12:51:08 +02:00
af045f182b MXS-406: added set_donor_nodes in GALERA_MONITOR struct
Missing set_donor_nodes field added to GALERA_MONITOR struct
2017-01-16 22:41:49 +01:00
3c532430f9 MXS-406: Galeramon to set the preferred donor nodes
Galeramon queries all slave nodes for SHOW VARIABLES LIKE
'wsrep_node_name'

The server list, currently not sorted, is used in SET GLOBAL
wsrep_sst_donor = “list”. The statement is sent to all slave nodes
2017-01-16 16:23:09 +01:00
936f8c438f Add support for wildcards in hostnames
MXS-391. The user hosts in the SQL backends can now contain wildcard
addresses (e.g.basicuser@%.com or someuser@myhost_.org). Authenticating
these types of users is rather heavy since it requires looking
up the client host name.
2017-01-16 16:10:44 +02:00
2cabcea211 Add definitions of MXS_MODULE_NAME to all modules
All modules now declare a name for the module. This is name is added as a
prefix to all messages logged by a module. The prefix should help
determine which part of the system logs a message.
2017-01-16 11:28:34 +02:00
d054bc9b04 Split config.h into external and internal parts
The external config.h header defined functions and structures that are
intended to be used by modules. The internal header contains functions
that are used only by the MaxScale core.
2017-01-16 11:02:34 +02:00
74c55e5c82 Remove qc_is_real_query use from mqfilter
The use of this function is not necessary as it is only done as an
optimization.
2017-01-16 10:56:33 +02:00
cbdab48237 Remove unused functions from config.h
The header is divided into two parts, an external and an internal one. The
actual splitting is done in a later commit and this commit only prepares
the header for the split.
2017-01-16 10:56:33 +02:00
08b5d5c957 Detect redefined rules
If a rule is defined more than once, an error is logged and the parsing
fails.
2017-01-16 10:56:33 +02:00
c13a2eeb33 Hide definition of MXS_FILTER_DEF
MXS_FILTER_DEF is now private the MaxScale core.
2017-01-16 10:47:00 +02:00
41d2d65e71 Use new type names in insertstream
Use the renamed types and change numeric constants to defines.
2017-01-13 18:28:37 +02:00
1911430e96 Clean up insertstream source documentation
Cleaned up code and source documentation.
2017-01-13 17:39:27 +02:00
4869eccdc4 Improve insert value checks in insertstream
The filter now checks that the fields are implicitly listed instead of
explicitly defined.
2017-01-13 17:39:27 +02:00
95ffa1c689 Add insert streaming filter
The filter converts bulk inserts inside transactions into LOAD DATA LOCAL
INFILE statements. This allows multiple INSERT statements to be streamed
in a more efficient manner.

The module should be in the experimental package as it is still at an
experimental stage.
2017-01-13 17:39:27 +02:00
1f1abbb37b Make rule matching stricter
The rules are now matched even for trivial queries which don't target
actual tables.
2017-01-13 17:37:28 +02:00
de07f1d69d Fix luafilter build failure
The luafilter used old names.
2017-01-13 15:28:36 +02:00
60d4e17996 Allow restriction of module command arguments
The module commands now support an optional flag for arguments that when
enabled checks that the argument module name matches the registered domain
name. This can be used to enforce argument type validity for arguments
that are given to modules that expect objects of a certain type.

For example, this is used by the cache and dbfwfilter to prevent valid
filters but of the wrong type being given as arguments.
2017-01-13 15:28:36 +02:00
265e5c0593 Rename FILTER_DEF to MXS_FILTER_DEF
Provide functions that allows the actual definition of MXS_FILTER_DEF
to be made private.
2017-01-13 14:30:11 +02:00
affec5e388 Rename FILTER_VERSION to MXS_FILTER_VERSION 2017-01-13 14:28:20 +02:00
a41188bd5e Rename FILTER_VERSION to MXS_FILTER_VERSION 2017-01-13 14:26:45 +02:00
424849a9a2 Rename UPSTREAM to MXS_UPSTREAM
And DOWNSTREAM to MXS_DOWNSTREAM
2017-01-13 13:40:03 +02:00
3e5e1bda6a Tee: Remove obsolete struct member
Tee no longer uses the dummy_filterdef FILTER_DEF member, so
it can be removed. That means that filter_free() can be removed
from the public filter.h include.
2017-01-13 12:40:17 +02:00
ce182e3788 Introduce opaque type for filter session data 2017-01-13 11:03:43 +02:00
d0cc246b79 Rename FILTER to MXS_FILTER 2017-01-13 10:21:51 +02:00
e7b951c434 Rename FILTER_OBJECT to MXS_FILTER_OBJECT
Other clarifications to follow.
2017-01-13 10:03:23 +02:00
463b2fb468 Remove relative path processing from filters
The filters don't need to process relative paths as the core handles
that. All path parameters are interpreted as relative to the module
configuration directory, /etc/maxscale.modules.d/.
2017-01-12 15:33:48 +02:00
e1a43c15c5 Masking: Add error handling
When receiving an error packet, we just abort whatever we were doing.
2017-01-12 14:44:04 +02:00