4901 Commits

Author SHA1 Message Date
Markus Makela
f0956276ae Fixed FindMariaDBConnector.cmake failing even if connector is installed
This will remove the need to build the connector if it already exists as
a system library.
2016-03-05 06:04:36 +02:00
Johan Wikman
a86903f3d0 Remove obsolete declarations.
And dummy definitions as well.
2016-03-04 14:10:34 +02:00
counterpoint
768ff24428 Ensure SSL_LISTENER structure is intialised to binary zero when allocated in configuration processing by using calloc instead of malloc. 2016-03-04 11:53:54 +00:00
Johan Wikman
739fe7039c Use new functions for accessing start- and uptime. 2016-03-04 11:55:47 +02:00
Johan Wikman
b7904bffb0 Expose maxscale starttime.
Maxinfo needs access to the time MaxScale was started.
Now exposed in a way similar to the uptime.
2016-03-04 11:55:47 +02:00
Markus Makela
9dc55735e7 Missing listeners are treated as warnings instead of errors
Missing listeners are no longer a cause for shutdown.
2016-03-04 10:58:12 +02:00
Markus Makela
dd9f7fbbb7 Fixed rwsplit length calculations for multi-statements
The calculations used the amount of bytes read instead of amount of bytes
available and also read one byte too much.
2016-03-04 09:56:18 +02:00
Markus Makela
d1837e0e4a Added more error logging and fixed parsing of packets in readwritesplit
Readwritesplit tried to parse COM_PING packets which only have one byte of
payload. This would cause the queries to fail to parsed.
2016-03-04 07:55:03 +02:00
Markus Makela
ab33515282 Fixed undefined servers being ignored
The missing server was logged but it was not considered an error.
2016-03-04 07:06:53 +02:00
Markus Makela
d3da98b58f Merge branch 'MXS-544' into develop-MXS-544-merge 2016-03-03 21:39:39 +02:00
Markus Makela
1a2bd8b234 Added FindLua.cmake from KitWare's repo for CMake 3.4.3
Some platforms did not have the FindLua.cmake file which caused errors on
configuration. Moved the invocation of find_package to the filter CMakeLists.txt
so that it is only called if the luafilter is built.
2016-03-03 16:42:48 +02:00
Markus Makela
cb8ea84853 No errors were logged when a service has no listeners
The starting of a service without listeners would fail but there wouldn't be
any log messages about the reason of the failure. In addition to this, MaxScale
would try to restart the service periodically which would lead to unnecessary
error messages.

With this change, missing listeners for services are considered configuration
errors.
2016-03-03 15:57:08 +02:00
Markus Makela
0ddb81ea16 Fixed threads=auto not working
The name of the parameter was compared to `auto` instead of the value.
2016-03-03 15:29:05 +02:00
Markus Makela
5f993f0b60 Updated documentation about multi-statements
The readwritesplit documentation now explains the multi-statement behavior in
more detail and provides information about situations where the default
multi-statement behavior can be disabled.
2016-03-03 15:05:28 +02:00
Markus Makela
76f06572ed Fix to multi-statement processing
Renamed is_mysql_comment_start to is_mysql_statement_end because it checks
whether a statement truly ends instead of just checking comment block starts.

The calculations for buffer length in readwritesplit now use the payload size
instead of the buffer size.
2016-03-03 10:44:11 +02:00
Markus Makela
8b6595aa68 Improvements and fixes to strchr_esc_mysql
The C style comments were not ignored and the -- style comments
did not check for the trailing whitespace and made return values char*.

The creation of a stored procedure would prevent sessions from using
any of the slave servers because readwritesplit would interpret
the creation statement as a multi-statement query.

Parts of modutil and readwritesplit now compare pointers to pointers instead of
converting pointers to integers.
2016-03-02 21:34:22 +02:00
Markus Makela
2589630b8e Unknown SQL commands are treated as writes
This will prevent any possible damage to a slave by new or unexpected commands.
2016-03-02 21:27:34 +02:00
Markus Makela
2a35312022 Cleaned up the usage of the connector library
The monitor permission checks didn't use the standard connection timeouts but
used hard-coded values. The config.c tried to connect to the embedded library
but since it is not used by it anymore, it always fails.
2016-03-02 21:27:34 +02:00
Markus Makela
9bfef5c7c1 Improved multi-statement detection in readwritesplit
Now comment blocks and identifiers quoted with backticks are taken into
consideration when multi-statements are processed.
2016-03-02 21:27:34 +02:00
Markus Makela
9b2748f50c Removed false warnings about readwritesplit parameter types
The warning was expecting the wrong return value and mistakenly interpreted that
the setting of the parameter failed.
2016-03-02 21:27:34 +02:00
Markus Makela
bb1e36e2a5 Updated connector version
The v2.2.1 tag had a bug where the timeouts were not working.
2016-03-02 21:27:34 +02:00
Markus Makela
8cf1479f79 Removed logging from SIGTERM and SIGINT handlers
The logging of messages in a signal handler is not safe and sometimes caused
MaxScale to hang.
2016-03-02 21:27:34 +02:00
Markus Makela
e1a8a6f373 Luafilter is not built by default
The luafilter requires the lua development libraries so it isn't built
by default.
2016-03-02 13:37:00 +02:00
Markus Makela
b2742f02b9 More formatting of code
Code formatting.
2016-03-02 13:28:12 +02:00
Markus Makela
2204a245c9 General cleaning up of the luafilter
Renamed variables to make their use more clear and cmake now looks for the Lua
libraries.
2016-03-02 13:28:12 +02:00
Markus Makela
140d284eed Updated documentation for luafilter
Added more documentation to functions about how, when and with what parameters
the Lua functions are called with. Also adjusted the module version to experimental.
2016-03-02 13:27:24 +02:00
Markus Makela
1c74ca0ec7 Cleaned up the luafilter. 2016-03-02 13:27:24 +02:00
Markus Makela
3f3c553736 Finalized query blocking. 2016-03-02 13:26:50 +02:00
Markus Makela
5d0f3eb467 Added a simple test for Lua return values from fuction calls. If the Lua function returns a string, the current query is replaced with it. 2016-03-02 13:26:50 +02:00
Markus Makela
7e24d4c88b Added missing calls to the global script 2016-03-02 13:26:49 +02:00
Markus Makela
61ec8458d3 Initial implementation of a Lua filter 2016-03-02 13:26:49 +02:00
Markus Makela
2a2fdb2cc6 testing of Lua 2016-03-02 13:26:10 +02:00
Johan Wikman
1d4779215d Ensure symbols are resolved at link-time.
With the linker flags "-Wl,-z,defs", all symbols used by a library
are resolved at link-time. Otherwise they will be resolved at runtime.
The use of these flags ensures that missing symbols are found as
early as possible.

Case in point, the binlog router test-cases failed, because the loading
of the binlog router failed due to missing symbols my_uuid_init and
my_uuid. The reason was that when maxscale no longer was linked with
the embedded library, those symbols were not available.

Now we know that the loading of the binlog router will not fail due
to missing symbols.
2016-03-01 21:29:13 +02:00
Johan Wikman
9b5550c053 Link binlog router with embedded lib.
Binlog router uses my_uuid_init and my_uuid, which are non-public
functions available in the embedded library. Consequently, blr
must currently be linked with the embedded library.

A custom implementation of these functions should be provided, in
order to break that dependency.
2016-03-01 21:25:47 +02:00
Johan Wikman
9a0534d0f6 Use maxscale_uptime().
MaxScaleUptime() has been renamed to maxscale_uptime(). Take
prototype from include file.
2016-03-01 21:23:43 +02:00
Johan Wikman
52e1b24975 Rename and export MaxScaleUptime()
MaxScaleUptime() renamed to maxscale_uptime() and moved from
gateway.c (MaxScale main) to misc.c, which is included in the
maxscale_common library. That way the symbol will be available
at link-time and will thus not prevent the use of the linker
flags -Wl,-z,defs (resolve all symbols at link-time) when
linking a module that uses maxscale_uptime().
2016-03-01 21:23:03 +02:00
Johan Wikman
cb3213af63 server/include/poll.h renamed to server/include/maxscale/poll.h
Due to an include conflict between /usr/include/poll.h and
maxscale/server/include/poll.h the latter was moved to
maxscale/server/include/maxscale/poll.h.

Once 1.4 is out, all maxscale header files will be moved to that
same sub-directory. That will prevent include conflicts and also
make it easy to see which include files belong to maxscale and
which do not.
2016-03-01 12:56:39 +02:00
Markus Makela
955187d9fa Improvements on pathname handling of maxkeys and maxpasswd
The default pathname for maxkeys was a hardcoded value and it didn't use
the default directory location functions. If encrypted passwords were used
nothing was written into the log.
2016-03-01 10:57:13 +02:00
Markus Makela
8ebc887e1d Fixed typo in variable name
The embedded library headers need to include the parent directory and the
include command used the wrong variable name.
2016-03-01 10:54:04 +02:00
Markus Makela
bf1a789376 Added configurable multistatement behavior
Whether all queries should be routed to the master after a multistatement
query is executed can now be controlled with the `strict_multi_stmt` option.

When the option is disabled queries executed after a multistatement query will
be routed normally.
2016-03-01 10:45:08 +02:00
Markus Makela
ac007fa8f5 MXS-497: Multi-statement queries are always routed to the master
This will prevent the routing of queries that modify data to the slaves.

In the future a more intricate solution can done where all the statements
are parsed and the destination is resolved based on the actual contents.
2016-03-01 09:32:55 +02:00
Markus Makela
b88d66357e Shard router is no longer built by default
The shardrouter module is not finished and should not be built for releases.
2016-02-29 17:18:20 +02:00
Markus Makela
1ebb998056 Fixed wrong DCB being used in gw_get_shared_session_auth_info
The caller DCB was used instead of the session client DCB. This caused
a crash when a backend DCB was getting the shared data since those DCBs
have a NULL data pointer.
2016-02-29 16:53:39 +02:00
Markus Makela
2990c3b25f Fixed wrong variable being freed in qlafilter
The match parameter was freed twice.
2016-02-29 16:17:55 +02:00
Johan Wikman
1958df60cc Version updated to beta-1.4.0 2016-02-29 15:37:11 +02:00
Markus Makela
bf24f18805 Merge branch 'develop' into MXS-544 2016-02-29 10:40:33 +02:00
Markus Makela
f03865f32a Cloned DCB authentication data was freed twice
This caused all Tee filter sessions to crash when the branch DCB was closed.
2016-02-27 13:05:44 +02:00
Markus Makela
f77afc6374 Fixed possible crash when draining writequeue
The write queue spinlock was released in dcb_write_tidy_up without first
acquiring it. This caused a crash when two threads try to interact with
the write queue at the same time.
2016-02-26 20:45:41 +02:00
Markus Makela
b5b27740e3 Fixed wrong comparison being made when setting readwritesplit parameters
The comparison was done with strcmp but it was expected to return true on
success when in reality it returns 0 on success.
2016-02-26 18:06:46 +02:00
Markus Makela
87ccff097d Minor fix to token processing of dbfwfilter
The yylineno was manually simulated even though it can be automated by enabling
the yylineno option.
2016-02-26 12:30:56 +02:00