Sometimes you want to know whether the parsing using different
queryclassifiers differs, irrespective of whether they agree
upon the outcome or not.
With -R it is now possible to cause a difference in the return
value of qc_parse() to be printed.
When developing the oracle related parser extensions, it makes
things simpler if also qc_mysqlembedded properly reports when
it cannot parse a statement.
Note, although this change is marked for 2.1, it will not be
merged into the first 2.1 GA release.
EXPLAIN statements are no longer parsed completely as doing so makes
it hard to modify the grammar for the needs or Oracle SQL.
Consequently, for an EXPLAIN statement you now bascially only get the
type and the operation (the newly added QUERY_OP_EXPLAIN and QUERY_OP_SHOW).
The other information is not interesting and is related to
information_schema and similar tables.
Changed the query operation enum to contain implicit enum values instead
of providing. The operation was never used as a bitmask so it is pointless
to declare them as such.
Added the EXECUTE type to the enum and used it in qc_sqlite and
qc_mysqlembedded.
If the version if >= 10.2.3 recognized/builtin Json function should
be typed as QUERY_TYPE_READ while unrecognized ones should be typed
as QUERY_TYPE_READ | QUERY_TYPE_WRITE.
By default, only the essentials - the type and the operation - of
a statement will be collected and only if fields, tables, functions
and databases are explicitly asked for, will they be collected.
However, a statement will be parsed at most twice; if parsing is
needed a second time then all information will be collected.
If it is known that some particular information is needed, then
qc_parse() can be called explicitly to ensure it is collected
at first parsing.
It is now possible to specify what information the caller is interested
in. With this the cost for collecting information during the query parsing
that nobody is interested in can be avoided.
The static capabilities declared in getCapabilities allows certain
capabilities to be queried before instances are created. The intended use
of this capability is to remove the need for the `is_internal_service`
function.
The process and thread initialization/finalization of the query
classifier plugins is handled using the process and thread
initialization/finalization functions in the module object.
However, the top-level query classifier will also need to perform
process and thread initialization when transaction boundaries are
detected using regular expressions.
GCC on CentOS6 thinks there is an array-bounds error in the sqlite
code. As that code is outside our hands, it is easiest to instruct
GCC not to treat it as an error.
As every thread has a separate (in-memory) database, i.e. not
just a separate _connection_, sqlite can be compiled in singe-thread
mode, which means that there will be *no* locking.
The embedded parser is not capable of parsing preparable statements
containing ?:s as ordinary statements, so they have to be replaced
with something else. Replacing them with a dummy variable cannot be
done as that will affect the type of the statement. Replacing with
0 seems to be a good compromise.
Since the whole preparable statement will be available, it is
superfluous to provide a function using which the operation of
the preparable statement can be obtained.
This function will return the preparable statement of a PREPARE
statement as a COM_QUERY GWBUF. That is, once obtained, the normal
query classifier functions can be used for obtaining information
about the preparable statement itself.
- Only types of fixed size used in API interface
- The actual function return value specifies whether the parsing
process succeeded, while "logical" return values are returned
as out arguments.
The wrapper function currently ignores the function return value.
MXS-1070
Now both qc_mysqlembedded and qc_sqlite return the same stuff
for the same statement, and both include also operators in
addition to pure functions. Whether that is the right approach,
is still subject to debate.
However, if we want to make it possible to disable e.g. the
use of concat as in "select concat(a) from t", where a is a string,
to prevent the bypassing of the masking filter, then conceptually
it should be possible to prevent "select a+0 from t", where a is an
int, as well.