7278 Commits

Author SHA1 Message Date
Johan Wikman
1d2ca5cde7 MXS-1196: Translate NVL into IFNULL 2017-06-28 21:33:04 +02:00
Johan Wikman
abd12d1376 MXS-1196: Add Oracle test 2017-06-28 21:33:04 +02:00
Johan Wikman
c46f16041e MXS-1196: Ignore the DUAL table
The embedded parser ignores the DUAL table so it's better if
qc_sqlite does that as well.
2017-06-28 21:33:04 +02:00
Johan Wikman
339cc6cc0c MXS-1196: Add Oracle tests to the test suite 2017-06-28 21:33:04 +02:00
Johan Wikman
e6f8432e33 MXS-1196: Accept :'a' as placeholder variables
Oracle SQL accepts statements like

  PREPARE stmt FROM 'INSERT INTO t1 VALUES (:a,:b)';
  PREPARE stmt FROM 'INSERT INTO t1 VALUES (:"a",:"b")';

That is, the variable may be surrounded by quotes.
2017-06-28 21:33:04 +02:00
Johan Wikman
dece33f7b5 MXS-1196: Ignore "reset master"
Qc_sqlite does not parse that, so it needs to be commented out in
test files.
2017-06-28 21:33:04 +02:00
Johan Wikman
e80a378213 MXS-1196: Add 'sql_mode' argument to qc_sqlite 2017-06-28 21:33:04 +02:00
Johan Wikman
50413c5195 MXS-1196: Add Oracle specific tests
Copied from .../server/mysql-test/suite/compat/oracle/t

Will be used as a baseline and edited as needed.
2017-06-28 21:33:04 +02:00
Johan Wikman
8c1d53192c MXS-1196: Handle REPLACE explicitly
Allowing REPLACE to implicitly decay into an identifier does not
work.
2017-06-28 21:33:04 +02:00
Johan Wikman
ceaf2110ab MXS-1196: Add smarter delimiter handling
DELIMITER $$;
--delimiter $$
2017-06-28 21:33:04 +02:00
Johan Wikman
e7ef6c855f MXS-1196: Register if variables are used in function calls 2017-06-28 21:33:04 +02:00
Johan Wikman
593070b865 MXS-1196: Tentative commit 2017-06-28 21:33:04 +02:00
Johan Wikman
0de99dc686 MXS-1196: Use a syntactically correct stmt for init 2017-06-28 21:33:04 +02:00
Johan Wikman
32d4a6a8c7 MXS-1196: Oracle mode needs to be turned on repeatedly
Seems it not sufficient to turn it on when the qc module is loaded.
2017-06-28 21:33:04 +02:00
Johan Wikman
9ea380c456 MXS-1196: Turn on 10.3 mode for qc_sqlite
Turn on 10.3 mode for qc_sqlite if qc_mysqlembedded is built using 10.3.
2017-06-28 21:33:04 +02:00
Johan Wikman
422ea7f912 MXS-1196: In 10.3 a unary minus is not a function 2017-06-28 21:33:04 +02:00
Johan Wikman
0c51dd75fe MXS-1196: Pre 10.3 or 10.3 mode selected with option
The embedded parser of 10.3 parses things slightly differently than
how the embedded parser of earlier releases does. When comparing the
output of different query classifiers you need to be able to specify
with what qc_sqlite should be compatible with.
2017-06-28 21:33:04 +02:00
Johan Wikman
e0c78d4242 MXS-1196: Qc arguments are separated by ",", not by ";" 2017-06-28 21:33:04 +02:00
Johan Wikman
8a0455c2fe MXS-1196: Allow delimiters to be multi-character
In some new test files, the delimiter is 2 characters.
2017-06-28 21:33:04 +02:00
Johan Wikman
53dfa818e3 MXS-1196: Make MODE_ORACLE optional
Turned on by providing an argument when loading the query classifier.
2017-06-28 21:33:04 +02:00
Johan Wikman
cd6e9fa44b MXS-1196: Extend flags of compare
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.
2017-06-28 21:33:04 +02:00
Johan Wikman
62a64cba31 MXS-1196: Report user var read when prepared statements 2017-06-28 21:33:04 +02:00
Johan Wikman
da0900786a MXS-1196: Accept UNIQUE as synonym for DISTINCT 2017-06-28 21:33:04 +02:00
Johan Wikman
518f7e81ca MXS-1196: Handle preparable statements when db is 10.3 2017-06-28 21:33:04 +02:00
Johan Wikman
298d5642f6 MXS-1196: Accept top-level variable assignments
In Oracle you can write

    set autocommit=1
or
    autocommit:=1
2017-06-28 21:33:04 +02:00
Johan Wikman
9ae3ab522d MXS-1196: Turn on Oracle compatibility 2017-06-28 21:33:04 +02:00
Johan Wikman
13fad9933c MXS-1196: Make qc_mysqlembedded 10.3 compatible.
- Strings no longer null-terminated but pointer + length.
- Preparable statements NOT yet handled.
2017-06-28 21:33:04 +02:00
Johan Wikman
b191e6ecda MXS-1196: qc_mysqlembedded will not always claim a stmt was parsed
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.
2017-06-28 21:33:04 +02:00
Johan Wikman
43ab0f036e MXS-1196: Do not parse EXPLAIN statements
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.
2017-06-28 21:33:04 +02:00
Johan Wikman
951c96383c MXS-1196: Sort operation constants 2017-06-28 21:33:04 +02:00
Johan Wikman
49897a22ad MXS-1196: Make operation constants sequential
The operations do not form a bitmask. Consequently their
values can be sequential.
2017-06-28 21:33:04 +02:00
Johan Wikman
92d9356968 Update release notes, change log and upgrading 2017-06-28 12:13:10 +02:00
Markus Mäkelä
8e3d4d9dd2 MXS-1298: Fix typo in avro error message
Changed 'numer' to 'number'.
2017-06-28 11:52:50 +03:00
Markus Mäkelä
2bc5188dae MXS-1304: Don't null-terminate buffers in gw_str_xor
The gw_str_xor function is used only for doing XOR operations on binary
buffers.
2017-06-28 11:36:17 +03:00
Markus Mäkelä
40b1739249 MXS-1299: Fix CREATE TABLE t1 LIKE t2 processing
The creation of tables from other tables was not working even though the
information was available inside the avrorouter.
2017-06-28 11:25:57 +03:00
Markus Mäkelä
84925b3f10 Merge branch '2.0' into 2.1 2017-06-28 10:59:06 +03:00
Markus Mäkelä
9b0631f30b MXS-1289: Fix crash on TABLE_MAP with ID > 1024
The active table map was acquired with a modulo operation on the size of
the array instead of the number of elements.
2017-06-28 08:49:57 +03:00
Markus Mäkelä
7bb76f52e5 Disable ssl_load_galera test
The normal replication version of the test is disabled so there is no
reason to have the Galera version enabled.
2017-06-28 08:10:49 +03:00
Markus Mäkelä
dc849d1c0f MXS-1291: Attempt to bind on 0.0.0.0 when :: fails
If binding on the IPv6 all interfaces address fails, MaxScale will attempt
to bind on the IPv4 address.
2017-06-27 21:27:20 +03:00
Markus Mäkelä
1df8fda93f Merge branch '2.0' into 2.1 2017-06-27 20:52:58 +03:00
Markus Mäkelä
cd09e65714 MXS-1296: Always use a case-insensitive parser
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.
2017-06-26 21:05:42 +03:00
Timofey Turenko
9737ffe092 Fix masking tests
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.
2017-06-26 12:22:39 +02:00
Johan Wikman
90ab2bc106 Update 2.1 version 2017-06-26 12:09:18 +03:00
Johan Wikman
500f79a150 MXS-1296: Test that lc statements are parsed correctly
The transaction boundary parser - TrxBoundaryParser - must handle
upper and lowercase statements correctly.
2017-06-26 10:57:27 +03:00
Markus Mäkelä
bd1da82c96 Fix cdc_schema.py
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.
2017-06-23 11:10:41 +03:00
Markus Mäkelä
b29cda10a2 Merge branch '2.0' into 2.1 2017-06-20 10:45:02 +03:00
Markus Mäkelä
469ed1de1b MXS-1271: Remove unnecessary encode call
The trailing newline can be removed from the string without encoding it
first.
2017-06-20 10:40:22 +03:00
Esa Korhonen
b7a6e4b7b0 Fix HintParser line break detection
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.
2017-06-19 10:49:47 +03:00
Markus Mäkelä
567fbce735 MXS-1287: Assign Slave status for all external slaves
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.
2017-06-16 22:26:33 +03:00
Esa Korhonen
7e59254454 Change modutil_get_SQL() to modutil_extract_SQL() + length limit
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.
2017-06-16 10:07:27 +03:00