When the current database is implicitly used in a query that also uses an
explicit database, it must be routed to the shard which has the current
database.
As cross-shard joins are not supported, the safest, and possibly the most
expected course of action to take, is to route it to the so-called default
shard. The default shard is the shard that contains the database that is
currently set as the active database with a COM_INIT_DB, a text protocol
USE <database> query or it was set at connection time.
The avrorouter failed to detect ALTER TABLE statements which caused a
regression. Extended the alter table tests to parse the JSON for more
strict validation of test results.
The multimaster node detection uses stacks to sort the node groups. The
size of this stack was always assumed to be positive but it was possible
that it dropped down to -1 causing a crash when the stack was accessed
with the index number.
The test dropped the 'test' database which is heavily used both for
checking functionality and running tests. A better alternative is to use a
custom database that is only used by this test.
The EVP_CIPHER_CTX is now created inside a wrapper function to add support
for OpenSSL 1.1. Also fixed improper use of the EVP_CIPHER_CTX internals
in binlogrouter.
OpenSSL 1.1 supports most of the native threading libraries, including
pthread. This means that only versions before 1.1 need the thread handling
code.
The two cases where the case-sensitive parser functions were used don't
appear to hold any special meaning. The case-insensitive function should
be used as it implements a superset of functionality compared to the
case-sensitive version.
The masking filter now has a default fill value, so that if a
provided value does not match, then "X" is used.
The tests were modified to use "Y" as an explicitly provided
fill value (to distinguish from the default "X") and the results
were the default fill value would kick in were modified accordingly.
There's no need to use Python 3 for the script and using it introduces
problems due to the poor availability of MySQL Connector/Python for
Python3.
ENUM, SET and DECIMAL values should have a length of -1 as the length is
meaningless for these types.
The HintParser wrongly ignored linebreaks, causing parsing faults
e.g. parsing too far or accepting invalid comments. Now, the parser
detects a line break and terminates comments unless they started with
'/*'. Also, fixed a memory leak when parsing parameter-value-combinations.
Whenever a server which is a slave of an external master is detected, it
will be assigned the slave status. This will allow the status to be used
the way it was intended to be used.
The modutil_get_SQL()-function allocates storage, while
modutil_extract_SQL() does not. The strings given by the latter
are not 0-terminated so require a length limit when matched using
regexec().
This commit changes the used function in those cases where the
sql-string is not modified nor is the pointer saved for later use.
The CREATE USER statement in the example document now also has a
password. This should make it more obvious that the same credentials must
work from all hosts.
The timeout is hit very often if the cluster fixing takes some time. This
causes false positives so the timeout should be stopped before attempting
to fix the cluster.
The length parameter is not set to the required string length unless a
parameter is set. The previous length should be stored before calling
pcre2_substitute.
The addition of field types and lengths wasn't added to the avrorouter
ALTER TABLE handler. This caused crashes when an alter table was done and
new rows were inserted afterwards.
The `monitoruser` and `monitorpw` parameters were mislabeled as `monuser`
and `monpw`. To allow backwards compatibility, the `monuser` and `monpw`
still work as aliases for the correct commands.
The test seems to fail when executed outside of a debugger. A delay
between creating the connections and checking the connection count appears
to fix the problem.
Refactored the test to use stack allocated objects and favored assertion
style functions over conditional clauses with failing assertions inside
them.