The enums exposed by the connector are not intended to be used by the
users of the library. The fact that the protocol, and other, modules used
it was in violation of how the library is intended to be used.
Adding an internal mapping into MaxScale also removes some of the
dependencies that the core has on the connector.
Cleaned up the MaxScale version of the mysql.h header by removing all
unused includes. This revealed a large amount of dependencies on these
removed includes in other files which needed to be fixed.
Also sorted all includes in changed files by type and alphabetical
order. Removed explicit revision history from modified files.
By processing each buffer individually, the need to iterate over the whole
resultset is removed. Profiling showed that most of the time was spent
navigating the linked list of buffers when an offset into the whole
resultset was used instead of an offset to the individual response buffer.
Thread-local non-POD types are not supported on CentOS 6 and thus they
need to be replaced with pointers to the relevant objects and initialized
at runtime.
In addition to this, functor objects don't appear to work as expected in
CentOS 6 and replacing them with a simple for-loop seems to work.
When a COM_CHANGE_USER was executed, it is possible that the server
responds with a AuthSwitchRequest packet instead of an OK packet. In this
case, the server sends a new scramble which must be used to create the 20
byte hash that is expected as the response.
With GTID master registration always get filename from GTID repo.
The filestem option is not written if binlog_name is not set: this is
not needed by GTID registration.
router->fileroot is set when last name is loaded from GTID repo.
The basic rule type that matches everything was not created when a rule
with only an optional part was defined. This caused a crash when only one
rule with only an optional part was created. This was caused by the
expectation that the list of rules was never empty.
Reloading of rules now properly uses the current rule file if no argument
was provided. The rule version counter also used atomic operations for the
sake of correctness.
The rule parsing is now only required for DML type statements that should
be fully parsed.
Only text format queries (COM_QUERY, COM_STMT_PREPARE) can be parsed by
the query classifier.
Also fixed invalid use of a NULL value in a string constructor.
The DbfwSession now only exposes the necessary methods with the exception
of the DOWNSTREAM and UPSTREAM structures. These will be handled when the
session implements the filter template.
Renamed the structures to C++ naming style and added initial declarations
for DbfwSession methods.
The DbfwSession methods are not yet fully implemented which is why parts
of the class are still public. The intention is to use the filter template
when the session class is sufficiently refactored.
Removed the rule type enum and replaced it with a string description of
the type. Moved the rule type and name strings as private to the Rule
class. Replaced the need_full_parsing of the base class with a simple
constant.
Removed the unused array of rule names as well and the STRLINK structure
and the functions that use it.
The rule matching implementations are now done in the ColumnsRule,
FunctionRule and FunctionUsageRule classes. The query_matches function now
also takes the session as its first parameter to relay session related
information to the rule. This will be needed by the LimitQueriesRule
class.
Added the implementations of the query_matches method for the RegexRule,
WhereClauseRule and WildCardRule classes and moved the query matching code
into these functions.
The User class now only exposes the `match` method which can be used to
check if any of the rules for a user match a query. Further cleanup is
required once individual rule classes have been implemented.
The User class now handles the appending of the rules by itself and it
also provides a method for accessing the name instead of exposing the name
itself.
The rules matching is still done externally to the User class and moving
it into the User class depends on other changes being made first.
The core declarations of the dbfwfilter are in dbfwfilter.hh, the rules in
rules.hh and the users in users.hh. The implementation of the rules is in
rules.cc.