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.
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.
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.
The older versions of Bison use the deprecated versions of various options.
The automatic prefixing of tokens is not present in older versions so to
accommodate for this, all tokens were manually prefixed.
The change fixes a crash when no filebase parameter is given for the filter.
The instance creation functions of these filters had spossible memory leaks in
case errors in the configuration occurred. In addition to these, they would be
successfully created even if unexpected parameters were given.
The tee, qlafilter, namedserverfilter and topfilter now support the same filter
options: case, ignorecase and extended. The extended filter option enables
the Extended Regular Expression syntax for the filters which is used when
matching queries.
The lack of user definition lines in the dbfwfilter rule file was ignored
previously but this change makes the lack of users an error again. Also
added function documentation to some of the functions.
The real username and host is now logged in addition to the user definition
that it matched. The messages also have the service name to distinct
connections to two different services which both use the same filter.
The dbfwfilter now uses flex to tokenize the rules and bison to process those
tokens into a language. This will make the syntax checks more robust and
the rule language easier to maintain. It also makes the processing of rules
easier to understand and removes most of the C language side checks for
correctness.
The old rule processing functions are still left intact and will be removed
at a later point.
When configured to log matching queries, the dbfwfilter will log all queries
that match a rule. The rule name, user name and the query itself are logged.
It is also possible to match all queries that do not match a rule. Only the user
name and query is logged in this mode.
Now, qc_mysqlembedded is linked against MySQL's embedded library,
and MaxScale itself against Connector-C.
So, in order to build MaxScale, Connector-C must be installed.
This has been tested with Connector-C 2.2.1.
The build variable MYSQLCLIENT_LIBRARIES is no longer used.
Only the query classifier needs the functionality of the embedded
server, while the rest of MaxScale is content with the client
library or Connector/C.
This have now been rearranged so that query-classifier links with
the embedded static library and then explicitly exports its own
functions using the query_classifier.map linker script. That way
query classifier will use the embedded library, while the rest of
maxscale use the client library, and this without conflicts.
Currently, query_classifier is not linked to maxscale-common,
but executables must link to maxscale-common and query_classifier.
This is the first change in an attempt to arrange the linking so that
more errors are detected at link-time.
- All files in server/core but for gateway.c are linked to one shared
library called maxscale-common.
- The files log_manager/log_manager.cc and utils/skygw_utils.cc are
built into maxscale-common as well.
- MaxScale itself consists now only of gateway.c and is linked with
maxscale-common.
- All plugins link with maxscale-common.
- All executables link in addition with {EMBEDDED_LIB}.
After this change, the change (MXS-517) where query_classifier is the
only component that uses ${EMBEDDED_LIB} and the rest mysqlclient can
be made much cleaner.
After a few additional steps, all shared libraries can be linked with
the linker flags "-Wl,-z,defs", which directs the linker to resolve
all symbols. That will require that all shared libraries list all the
libraries they need, but will at the same time ensure that any
missing symbols are detected at link-time and not at run-time.
Since the PCRE2 library was always going to be a part of MaxScale, there was
no real reason to have it as a shared library apart from smaller binaries.
The username matching was working as intended but the session's active value
was ignored when queries were being routed. This meant that both the username
and the IP address of the user were ignored and query replacement was always
done.