229 Commits

Author SHA1 Message Date
Johan Wikman
7cb3c68d1e MXS-1380 Parse UNIONs completely
Before this change, only db2.t2 was reported as table name for a
select like

    select * from db1.t1 union select * from db2.t2

With this change, db1.t1 and db2.t2 are reported.
2017-08-31 13:27:02 +03:00
Johan Wikman
ad4e8dad94 MXS-1364 Drop the usage field
But for the most trivial statements did not really provide
useful information.

The arguments of the "function" '=' are now reported.
2017-08-24 09:58:18 +03:00
Johan Wikman
bea56f40b2 MXS-1364 Disable irrelevant tests that do not pass 2017-08-24 09:58:18 +03:00
Johan Wikman
83ae19cd68 MXS-1364 Collect field usage of CASE and BETWEEN 2017-08-24 09:58:18 +03:00
Johan Wikman
597aacb313 MXS-1364 Compare should report function column usage 2017-08-22 11:01:50 +03:00
Johan Wikman
0630410bb2 Remove "unsupported" tests that are no longer unsupported 2017-08-17 09:21:52 +03:00
Johan Wikman
384633fc69 MXS-1247 Add all server window function tests 2017-08-17 09:21:52 +03:00
Johan Wikman
523e7ed445 MXS-1247 Add initial support for window functions
This commit will be followed by more tests.
2017-08-16 13:04:21 +03:00
Johan Wikman
27ef5c3048 MXS-1247 Set the server version explicitly 2017-08-16 12:59:35 +03:00
Johan Wikman
9d97902899 MXS-1307 CTE tests pass
There are some issues still
- With recursive CTEs qc_mysqlembedded and qc_sqlite agree upon
  the real columns, but disagree on the CTE related "virtual"
  columns. That's largely irrelevant though.
- qc_sqlite cannot parse "SET STATEMENT var=... FOR stmt",
  but it will be classified as QUERY_TYPE_GSYSVAR_WRITE.
  This is not directly CTE related.
2017-08-10 15:23:42 +03:00
Johan Wikman
4eeff705ee MXS-1307 Catch "union all" selects 2017-08-10 14:45:27 +03:00
Johan Wikman
05bbd9676b MXS-1307 Ignore usage differences for functions
Also in the case of functions, we ignore differences in reported
usage context between qc_mysqlembedded and qc_sqlite.
2017-08-10 12:54:47 +03:00
Johan Wikman
fdb588b866 MXS-1307 Tweak cte tests
The "parser" of compare cannot handle the following:

  prepare stmt1 from "
  with t as (select a from t1 where b >= 'c')
    select * from t2,t where t2.c=t.a;
  ";

That is, that a line *not* terminating the full statement (the
line 'select * from t2,t where t2.c=t.a;' above) ends with a ';'.
Thus, it needs to be changed into e.g.

  prepare stmt1 from "
  with t as (select a from t1 where b >= 'c')
    select * from t2,t where t2.c=t.a;";
2017-08-08 15:46:01 +03:00
Johan Wikman
a02bc3d40b MXS-1348 Treat usage differences as non-fatal
In the context of subselects and CTEs it is somewhat difficult to
make qc_sqlite and qc_mysqlembedded to agree upon in what context
a particular field is used. As that information is not used anywhere,
a usage discrepancy is for now treated as a warning.
2017-08-08 15:46:01 +03:00
Johan Wikman
4f4151bca9 MXS-1340 Report true table and not alias name
With this change, for a statement like

    SELECT t2.a FROM t1 t2;

the affected field is reported as t1.a and not as t2.a, as it
was before.

For a statement like

    SELECT t.f FROM d.t;

qc_mysqlembedded will now return "d.t.f" as the affected field,
while qc_sqlite will still return "t.f" as both implementations did
before. In qc_mysqlembedded's case that is a side-effect of the
alias handling. To get qc_sqlite to return the same (which would
be good), the table names would have to be collected in a smarter
way than they are now.
2017-08-08 15:46:01 +03:00
Markus Mäkelä
3eb99139f5 Merge branch '2.1' into develop 2017-07-31 15:57:05 +03:00
Johan Wikman
4985bf9b6e MXS-1328 Mark regexp functions as builtin functions
Regexp functions were not listed among the builtin read-only
functions and consequently any SELECT using one of those was
routed to master.
2017-07-27 09:58:32 +03:00
Johan Wikman
2d59148a9f MXS-1307 Grant statements excluded
MaxScale does not need to fully parse grant statements. Hence
they are commented out from cte_grant.test.
2017-07-27 09:22:19 +03:00
Johan Wikman
f7bd195e9f MXS-1248: Add CTE tests
All cte tests from the server
2017-06-30 13:01:14 +02:00
Johan Wikman
f91df4617a MXS-1248: Add simple cte test 2017-06-30 08:36:19 +02:00
Johan Wikman
6cd6ded3d8 Merge branch '2.1-oracle-compat' into develop-new-merge-oracle 2017-06-29 09:39:55 +02:00
Johan Wikman
f0ddbc5c8f MXS-1258: Remove non-critical failing test-cases
"SELECT LENGTH(_utf8 0xC39F), LENGTH(CHAR(14844588 USING utf8));"

Type and operation collected correctly, but function names are not
2017-06-28 21:36:08 +02:00
Johan Wikman
8128c74341 MXS-1196: Update Oracle tests 2017-06-28 21:36:08 +02:00
Johan Wikman
a690b44919 MXS-1278: Sql mode must be specified explicitly
The default sql mode must now be provided explicitly when the query
classifier is setup. This is in preparation for "sql_mode" becoming
a global configuration parameter of MaxScale.
2017-06-28 21:36:08 +02:00
Johan Wikman
12a291919a MXS-1275: SetSqlModeParser moved under MySQLClient
That's where it belongs as it is only the mysql client protocol that
will use it. It's a bit unfortunate that the qc test program compare
now needs to include a file from a protocol module directory, but
the fact is that the query classifier implementation and the test
programs should actually be *under* the mysql client protocol module.
2017-06-28 21:36:08 +02:00
Johan Wikman
51452ecb3b MXS-1275: No need to be explicit about the sql mode
As statements as "set sql_mode=oracle" are recognized and the
behaviour of the classifiers is configured accordingly, the mode
need not the hardwired.
2017-06-28 21:36:08 +02:00
Johan Wikman
a60b6473ed MXS-1275: Check for "set sql_mode=ORACLE" and act accordingly 2017-06-28 21:36:08 +02:00
Johan Wikman
368ae65779 MXS-1275: // is not an mysql comment token 2017-06-28 21:36:08 +02:00
Johan Wikman
cc0c193d2e MXS-1196: Run Oracle test only when built against 10.3 2017-06-28 21:33:04 +02:00
Johan Wikman
d9b4013b69 MXS-1196: Add Oracle tests 2017-06-28 21:33:04 +02:00
Johan Wikman
b492f09d61 MXS-1196: Add Oracle tests 2017-06-28 21:33:04 +02:00
Johan Wikman
dd5360d30c MXS-1196: Handle delimiter explicitly, ignore comments 2017-06-28 21:33:04 +02:00
Johan Wikman
fd3258f7f7 MXS-1196: Ignore mysqltest keywords unless delim is ; 2017-06-28 21:33:04 +02:00
Johan Wikman
a73200ad50 MXS-1196: Add Oracle tests 2017-06-28 21:33:04 +02:00
Johan Wikman
eaf5a4152b MXS-1196: Handle eol-comments
Eol-comments need to be followed by a newline as otherwise the
rest of a test-statement will be excluded.
2017-06-28 21:33:04 +02:00
Johan Wikman
332e1bbb7c MXS-1196: Add more Oracle tests 2017-06-28 21:33:04 +02:00
Johan Wikman
31f2b340ea MXS-1196: Add more Oracle tests 2017-06-28 21:33:04 +02:00
Johan Wikman
38863bd319 MXS-1196: Handle "exit" correctly
"exit" is both a mysqltest and PL/SQL keyword.
2017-06-28 21:33:04 +02:00
Johan Wikman
09b0c44be5 MXS-1196: Add new Oracle test 2017-06-28 21:33:04 +02:00
Johan Wikman
f26fb085bc MXS-1196: Handle "while" correctly
"while" is both a mysqltest and PL/SQL keyword.
2017-06-28 21:33:04 +02:00
Johan Wikman
b700a77da6 MXS-1196: Add test for Oracle sequences 2017-06-28 21:33:04 +02:00
Johan Wikman
8b4e092d26 MXS-1196: Give same argument to both classifiers 2017-06-28 21:33:04 +02:00
Johan Wikman
bea8513f9d MXS-1196: Amend default arguments with given 2017-06-28 21:33:04 +02:00
Johan Wikman
6b93a44be1 MXS-1196: Add PS tests
The names of the Oracle related tests are renamed as well to make it easier
to see what exactly fails.
2017-06-28 21:33:04 +02:00
Johan Wikman
fba45fd763 MXS-1196: Add more Oracle tests 2017-06-28 21:33:04 +02:00
Johan Wikman
6c334aa12c MXS-1196: Add Oracle test 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
339cc6cc0c MXS-1196: Add Oracle tests to the test suite 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
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