Commit Graph

198 Commits

Author SHA1 Message Date
a996ea58ef Merge branch '2.1' into 2.2 2018-03-21 13:27:51 +02:00
5be9a8d7f8 MXS-1730 Add test-case that reveals the problem 2018-03-21 13:25:06 +02:00
39d3c42c94 Merge branch '2.1' into 2.2 2018-03-01 17:52:42 +02:00
0c206ff428 MXS-1688 Handle ...INTERVAL N <unit>
"INTERVAL N <unit>" is now handled as an expression in itself and
as asuch will cause both statements such as

  "SELECT '2008-12-31 23:59:59' + INTERVAL 1 SECOND;"

and

  "select id from db2.t1 where DATE_ADD("2017-06-15", INTERVAL 10 DAY) < "2017-06-15";"

to be handled correctly. The compare test program contains some
heuristic checking, as the the embedded parser will in all cases
report date manipulation as the use of the add_date_interval()
function.
2018-03-01 17:39:03 +02:00
b7cc793c40 MXS-1688 Add test that reveals DATE_ADD problem 2018-03-01 17:39:03 +02:00
ef1ec2e524 MXS-1591 Mark GET_LOCK(...) et.al. as WRITE
The follwing statements

    SELECT GET_LOCK('lock1',10);
    SELECT IS_FREE_LOCK('lock1');
    SELECT IS_USED_LOCK('lock1');
    SELECT RELEASE_LOCK('lock1');

are now classified as QUERY_TYPE_READ|QUERY_TYPE_WRITE. That will
make cooperative locking work if these functions are used inside
non-read-only transactions and outside transanctions.
2018-01-29 15:25:21 +02:00
f129dd56be MXS-1595 Rename mysqlclient to mariadbclient
Documentation update will follow.
2018-01-05 10:01:50 +02:00
c31881914b MXS-1584 Correctly classify "SELECT NEXT VALUE FOR seq" 2018-01-04 10:11:19 +02:00
8b2aa52384 Merge branch '2.1' into 2.2 2017-12-29 08:42:49 +02:00
c6e0d1f33c Fix canonizer test programs 2017-12-27 15:34:18 +02:00
1908faf150 MXS-1527 Add test case 2017-12-27 14:14:51 +02:00
8ef8343f5c MXS-1391 Parse CREATE OR REPLACE 2017-09-25 14:24:42 +03:00
621b66ab13 Thread initialization added
Also the main thread must now explicitly be initialized.
2017-09-25 14:04:03 +03:00
d00c5b2838 Move thread initialization into Worker::run
By moving the initialization into Worker::run, all threads, including the
main thread, are properly initialized. This was not noticed before as
qc_sqlite initialized the main thread in the process initialization
callback.
2017-09-15 18:08:49 +03:00
45e0e8bb59 Introduce internal protocol command enum
The enums exposed by the connector are not intended to be used by the
users of the library. The fact that the protocol, and other, modules used
it was in violation of how the library is intended to be used.

Adding an internal mapping into MaxScale also removes some of the
dependencies that the core has on the connector.
2017-09-14 15:30:43 +03:00
a2d0d24b2c Merge branch '2.1' into develop
Bringing in MXS-1406
2017-09-13 10:02:37 +03:00
49ab5797a2 MXS-1406 Report CALL operation
Basically it would be trivial to report far more operations
explicitly, but for the fact that the values in qc_query_op_t
currently, quite unnecessarily, form a bitmask.

In 2.2 that is no longer the case, so other operations will be
added there.
2017-09-12 15:38:25 +03:00
02b9e0a01d Merge branch '2.1.7' into develop-2.1-merge 2017-09-12 11:08:02 +03:00
19cc3e67e1 MXS-1395 Allow NAMES to be used as keyword/id
NAMES is a keyword but not a reserved one. So it must be possible
to use it as an identifier as well.
2017-09-07 10:17:04 +03:00
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
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
bea56f40b2 MXS-1364 Disable irrelevant tests that do not pass 2017-08-24 09:58:18 +03:00
83ae19cd68 MXS-1364 Collect field usage of CASE and BETWEEN 2017-08-24 09:58:18 +03:00
597aacb313 MXS-1364 Compare should report function column usage 2017-08-22 11:01:50 +03:00
0630410bb2 Remove "unsupported" tests that are no longer unsupported 2017-08-17 09:21:52 +03:00
384633fc69 MXS-1247 Add all server window function tests 2017-08-17 09:21:52 +03:00
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
27ef5c3048 MXS-1247 Set the server version explicitly 2017-08-16 12:59:35 +03:00
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
4eeff705ee MXS-1307 Catch "union all" selects 2017-08-10 14:45:27 +03:00
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
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
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
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
3eb99139f5 Merge branch '2.1' into develop 2017-07-31 15:57:05 +03:00
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
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
f7bd195e9f MXS-1248: Add CTE tests
All cte tests from the server
2017-06-30 13:01:14 +02:00
f91df4617a MXS-1248: Add simple cte test 2017-06-30 08:36:19 +02:00
6cd6ded3d8 Merge branch '2.1-oracle-compat' into develop-new-merge-oracle 2017-06-29 09:39:55 +02:00
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
8128c74341 MXS-1196: Update Oracle tests 2017-06-28 21:36:08 +02:00
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
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
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
a60b6473ed MXS-1275: Check for "set sql_mode=ORACLE" and act accordingly 2017-06-28 21:36:08 +02:00
368ae65779 MXS-1275: // is not an mysql comment token 2017-06-28 21:36:08 +02:00
cc0c193d2e MXS-1196: Run Oracle test only when built against 10.3 2017-06-28 21:33:04 +02:00
d9b4013b69 MXS-1196: Add Oracle tests 2017-06-28 21:33:04 +02:00
b492f09d61 MXS-1196: Add Oracle tests 2017-06-28 21:33:04 +02:00