7073 Commits

Author SHA1 Message Date
Markus Mäkelä
9d56fc70f6 Update SchemaRouter.md 2017-04-20 09:27:24 +03:00
Markus Mäkelä
767ec74489 Update MySQL-Replication-Connection-Routing-Tutorial.md 2017-04-20 09:27:24 +03:00
Markus Mäkelä
94acc9b9ab Update MaxScale-HA-with-Corosync-Pacemaker.md 2017-04-20 09:27:24 +03:00
Markus Mäkelä
afe75e9006 Update Simple-Sharding-Tutorial.md 2017-04-20 09:27:23 +03:00
Markus Mäkelä
1e34bd7642 Update Notification-Service.md
Removed change history, changed company name.
2017-04-20 09:27:23 +03:00
Markus Mäkelä
a54d6fe816 Add connector plugindir to help output
The output now displays the connector directory.
2017-04-13 17:57:52 +03:00
MassimilianoPinto
f4a5134a83 MXS-1212: use res.length for buffer length instead of computing the size of the whole buffer chain
This reduces CPU usage and decreases the response time for result sets
with many rows.
2017-04-07 12:16:50 +02:00
Esa Korhonen
9e8ddc842c Fix leaks in testconfig 2017-04-06 12:51:09 +03:00
Esa Korhonen
15951423d8 Fix memory errors in test_poll and test_queuemanager
test_poll was calling poll_init() two times since it's already included in
init_test_env().

test_queuemanager was missing a bunch of frees. This doesn't fix it completely,
but removes most of the leaks and valgrind errors.
2017-04-05 17:37:21 +03:00
Esa Korhonen
b1f66d21c8 Fix valgrind-errors in test_filter and test_modutil
Reduces valgrind clutter quite a bit.
2017-04-05 15:04:36 +03:00
Esa Korhonen
2d987b25b2 Fix test_dcb
Set threadcount to one, don't check validity after freeing.
2017-04-05 10:49:43 +03:00
Esa Korhonen
e0a98f6539 Fix calls of pcre2_substitute
If the output buffer given to pcre2_substitute is too small, an error
value is written to the last parameter (output length). That value
should not be used for calculations. This patch gives a copy as
parameter instead.

Coincidentally, this commit fixes the crashes of query classifier tests.

Also, increase buffer growth rate in utils.c.
2017-04-04 16:19:21 +03:00
Esa Korhonen
dca086571b TestMaxScalePCRE2: Fix memory leaks
Not really leaks, but this reduces needless clutter in the valgrind
output.
2017-04-04 16:18:47 +03:00
Markus Mäkelä
872f69b681 Also check IPv6 mapped IPv4 addresses as IPv4
If a client connects from an IPv4 address, but the listener listens on an
IPv6 address, the client IP will be a IPv6 mapped IPv4 address
e.g. ::ffff:127.0.0.1. A grant for an IPv4 address should still match an
IPv6 mapped IPv4 address.
2017-04-04 15:28:39 +03:00
Markus Mäkelä
9f14f3659f Only check user permissions on startup
When users were loaded, the permissions for the service user were
checked. The conditional that makes sure the check is executed only at
startup was checking the listener's users instead of the SQLite handle
which caused all reloads of users to check the permissions.
2017-04-04 15:28:39 +03:00
Markus Mäkelä
860b14526c Fix mxs_mysql_is_result_set
The function assumed that the packet payload was always at least two
bytes.
2017-04-04 15:28:39 +03:00
Markus Mäkelä
1ff83150f0 Revert "Route statements in larger batches"
This reverts commit f3c83770903151a0a3b53593c3e05fa0af94cd5f. The
functionality was used implicitly by modules that declare the
RCAP_TYPE_CONTIGUOUS_OUTPUT capability.
2017-04-04 09:56:51 +03:00
MassimilianoPinto
0c3f9ffa2e Maxrows: documentation update and use of MXS_MODULE_PARAM_SIZE for max_resultset_size parameter
max_resultset_size parameter now uses MXS_MODULE_PARAM_SIZE and
config_get_size

Documentation change follows the change.
2017-04-04 08:43:55 +02:00
Markus Mäkelä
6ef90bf9b6 Add a warning about limit_queries and action=allow
The `limit_queries` rule should not be used in the `allow` mode.
2017-04-03 16:22:21 +03:00
Markus Mäkelä
d32a2e410b Use matched instead of blocked
As queries that match a rule aren't always blocked, it's more appropriate
to use `matched` instead of `blocked`.
2017-04-03 16:22:21 +03:00
Markus Mäkelä
108978fcd2 Format dbfwfilter documentation
Split lines that are longer than 80 characters.
2017-04-03 16:22:21 +03:00
Johan Wikman
8d2d6d8721 Join threads to prevent leaks 2017-04-03 14:20:54 +03:00
Johan Wikman
815780aa4a In cache testrules.c ensure there seems to be at least one thread 2017-04-03 14:20:54 +03:00
Markus Mäkelä
0f2f9d48b7 Improve maxadmin help messages
The help messages are now more descriptive and have usage information in
them. This should help users use the commands without relying on the
online documentation.
2017-04-03 12:09:59 +03:00
Markus Mäkelä
e650597eb5 MXS-1200: Document and increase line length limitations
The line length limitation is now increased to 16384 bytes. It is now
clearly documented in the limitations document.

The configuration parser now uses memory from the heap instead of the
stack. This should remove any problems caused by the larger line length.
2017-04-03 12:07:45 +03:00
Markus Mäkelä
f3c8377090 Route statements in larger batches
The RCAP_TYPE_STMT_OUTPUT is not used in its previous form. It can be
altered to route only complete packets back to the client. This allows
routers to do safer parsing on the results.
2017-04-03 12:07:45 +03:00
MassimilianoPinto
d4da5caf3b MXS-1211: MaxRows documentation update
MXS-1211: MaxRows documentation update
2017-04-03 08:39:12 +02:00
MassimilianoPinto
e6d2c96f5b MXS-1211: maxrows should be configurable to return error when limit has been exceeded
New parameter added to maxsrows filter:
max_resultset_return=empty|error|ok
Default, 'empty' is to return an empty set, as the current
implementation.
'err' will return an ERR reply with the input SQL statement
'ok' will return an OK packet
2017-03-31 14:26:44 +02:00
Johan Wikman
84ea6e6c8d Update ChangeLog 2017-03-31 15:09:16 +03:00
Johan Wikman
4abdfa2ff7 Update version number in branch 2.1
The next release will be 2.1.3, so better to have it in place now.
2017-03-31 15:09:16 +03:00
Markus Mäkelä
70c834026c Update launchable script documentation
Updated examples with new address formatting.
2017-03-31 14:12:58 +03:00
Markus Mäkelä
cbc1e864d9 Use RFC 3986 compliant addresses in log messages
When log messages are written with both address and port information, IPv6
addresses can cause confusion if the normal address:port formatting is
used. The RFC 3986 suggests that all IPv6 addresses are expressed as a
bracket enclosed address optionally followed by the port that is separate
from the address by a colon.

In practice, the "all interfaces" address and port number 3306 can be
written in IPv4 numbers-and-dots notation as 0.0.0.0:3306 and in IPv6
notation as [::]:3306. Using the latter format in log messages keeps the
output consistent with all types of addresses.

The details of the standard can be found at the following addresses:

     https://www.ietf.org/rfc/rfc3986.txt

     https://www.rfc-editor.org/std/std66.txt
2017-03-31 14:12:58 +03:00
Johan Wikman
32dca26c96 Merge branch '2.1.2' into 2.1 2017-03-31 13:32:51 +03:00
Johan Wikman
963750c240 Update version number to 2.1.2 2017-03-31 13:28:09 +03:00
Johan Wikman
8a86efc30e Fix gwbuf_clone
With this change, the test_clone() test in testbuffer.c no longer
causes a leak according to valgrind.
2017-03-30 22:16:51 +03:00
Johan Wikman
8284716e6a Add test for gwbuf_clone to testbuffer.c
- Under valgrind, this test reveals the leak of gebuf_clone.
2017-03-30 22:14:58 +03:00
Johan Wikman
29fa4a6088 Fix testbuffer.c
Free memory allocated by tests, so that it is meaningful to run under
valgrind in order to check for GWBUF leaks.
2017-03-30 22:02:34 +03:00
Johan Wikman
b4c119915b Fix gwbuf_rtrim
- If everything in the first buffer of a buffer chain is consumed,
  then the whole chain and not just the first buffer was freed.

NOTE: gwbuf_rtrim needs to be fixed so that it removes data from the
      tail of a chain and *not* from the end of the first buffer in
      a chain. That cannot ever be what is wanted.
2017-03-30 21:49:57 +03:00
Johan Wikman
726610b67d Use 64-bit integers for statistics in rwsplit
Wraparound is not likely anymore.
2017-03-30 12:44:27 +03:00
Johan Wikman
a1d1413b24 Add atomic_add for 64-bit integers.
Now only GCC intrinsics are used.
2017-03-30 12:36:23 +03:00
Markus Mäkelä
b458b63756 Use IPv6 for created listeners
When listeners are created, use the default values of [::]:3306.
2017-03-29 17:14:39 +03:00
Markus Mäkelä
1901a3bc0a Bind to IPv6 addresses by default
The `::` address covers both IPv4 and IPv6 addresses allowing both IP
versions to be used by default.
2017-03-28 21:25:30 +03:00
Johan Wikman
4b2d94d0f8 When a transaction has been started, no other checks are needed
If we do check then we will end up turning off the read only flag
that just was set on.
2017-03-28 16:17:13 +03:00
Markus Mäkelä
f2734f895e Revert "Update dbfwfilter build configuration"
This reverts commit 09ef292283311483354e6cd628318a5cafd96b2c. The old
syntax is still required on SLES 11.
2017-03-27 10:01:54 +03:00
Johan Wikman
27d81cda6a Merge branch '2.1.1' into 2.1 2017-03-22 13:06:41 +02:00
Johan Wikman
2d00fe1019 Remove references to old release notes 2017-03-22 13:02:18 +02:00
Johan Wikman
d70dad260a Implement collecting behaviour in qc_sqlite
By default, only the essentials - the type and the operation - of
a statement will be collected and only if fields, tables, functions
and databases are explicitly asked for, will they be collected.
However, a statement will be parsed at most twice; if parsing is
needed a second time then all information will be collected.

If it is known that some particular information is needed, then
qc_parse() can be called explicitly to ensure it is collected
at first parsing.
2017-03-22 11:09:36 +02:00
Johan Wikman
d0a9571da0 Introduce new qc_parse() prototype
It is now possible to specify what information the caller is interested
in. With this the cost for collecting information during the query parsing
that nobody is interested in can be avoided.
2017-03-22 11:09:36 +02:00
Johan Wikman
441b0204bf Update cache documentation 2017-03-22 11:04:48 +02:00
Johan Wikman
15a22ec295 Do not use shared PCRE2 match data
The match data needs to be unique for each thread, so for the time
being it is created whenever it is needed. A more performant (although
possibly to a negigible amount) solution would be to have a separate
match data for each thread, but that will have to wait for 2.2.
2017-03-21 15:21:13 +02:00