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.
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.
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.
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.
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.
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.
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.
If transaction safety was disabled and a large event sent in multiple SQL
packets was received, the distribution of that event to the slaves would fail.
The empty packet sent after a large event which fits into exactly one packet
was written to disk and the writing of no bytes caused it to be treated as
an error.
The router->last_written is used to store the position where the last event was
written. The replication header is also stored in a separate structure in
the router which is used later when the last packet of a multi-packet event
arrives.
The checking of the master status and the possible error logging were done
in two different steps. This led to confusing error messages when the state
of the server changed between the check and the logging of the error message.
When a command that changes the session state is executed on all servers and
a slave server goes down, an error message was sent to the client even though
one wasn't expected. These appeared as odd connection errors on the client side.
When a query is being routed to the slave, it is not necessary to assert that
the master server's state is still master. It is possible that the master server
changes states while the query is being routed but that doesn't affect the query
being currently routed.
The master DCB was checked for NULL-ness but the proper way is to check if
the backend reference is closed. This will fix a debug assertion in addition
to possibly preventing crashes.
When the shard maps are being updated they are set into a stale state. This
means that one client connection is updating the shard maps and the information
in the shard map is not the most recent. This does mean that the information
is valid and authentication should succeed even if the shard map is stale.
The include directories previously used by MaxScale were from the embedded
library. All parts of MaxScale apart from the query classifier now use
the client libraries.
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.
The query_classifier library is now only a wrapper that loads an
actual query classifier implementation. Currently it is hardwired
to load qc_mysqlembedded, which implements the query classifier
API using MySQL embedded.
This will be changed, so that the library to load is specified
when qc_init() is called. That will then allow the query classifier
to be specified in the config file.
Currently there seems to be a conflict between the mysql_library_end()
call made in qc_mysqlembedded and the mysql_library_end() call made in
gateway.c. The reason is that they both finalize a shared library.
For the time being mysql_library_end() is not called in gateway.c.
This problem is likely to go away by switching from the client
library to the connector-c library.
When a slave server fails to execute a session command, the log message printed
the command that was being executed as if the ERR packet was a COM_QUERY packet.
This caused corrupt strings to be printed into the error logs.