Commit Graph

746 Commits

Author SHA1 Message Date
4af67e95ff MXS-2732 Take newly installed sqlite3 into use
No code differences, but the used sqlite has now been installed
in one single commit.
2019-10-30 11:36:04 +02:00
c2a601bcf5 MXS-2732 Add MaxScale sqlite3 changes
This commit contains all MaxScale changes that have been made
to sqlite3 version 3110100.
2019-10-30 11:28:39 +02:00
d2db25073b MXS-2732 Update sqlite3 tool mkopcodeh.tcl from 3200000
The mkopcodeh.tcl of sqlite3 version 3110100 has a bug that
manifests itself so that it generates broken code depending on
what keywords there are and in what order. The mkopcodeh.tcl
from 3200000 does not have that problem.
2019-10-30 11:22:31 +02:00
6df8fb2497 MXS-2732 Add sqlite3 version 3110100 2019-10-30 10:58:24 +02:00
81e78726eb MXS-2732 Rename sqlite-src-3110100 to sqlite-src-3110100.old
Originally, the sqlite installation was imported into the MaxScale
repository in the one gigantic MaxScale 1.4 -> 2.0 commit.

Consequently, there is no import commit to compare to if you want
to extract all MaxScale specific changes. To make it simpler in the
future, sqlite will now be imported in a commit of its own.
2019-10-30 10:58:24 +02:00
861e27eb00 Merge branch '2.3' into 2.4 2019-10-29 14:04:31 +02:00
df6c56e7ca Update 2.3.13 Change Date 2019-10-29 12:51:31 +02:00
82826f2de5 MXS-2733 Add fix that fixes the problem
UTC_TIMESTAMP() was missing from the list of builtin functions.
2019-10-29 09:26:41 +02:00
d3407471b3 MXS-2733 Add test that reveals problem 2019-10-29 09:26:41 +02:00
840b771283 Merge branch '2.3' into 2.4 2019-10-28 09:16:53 +02:00
d2996e1ba6 MXS-2733 Add fix that fixes the problem
UTC_TIMESTAMP() was missing from the list of builtin functions.
2019-10-28 08:34:39 +02:00
9210ef5328 MXS-2733 Add test that reveals problem 2019-10-28 08:30:04 +02:00
312469dca2 Merge branch '2.3' into 2.4 2019-10-07 16:17:53 +03:00
e7e40b0179 MXS-2713 Classify SET PASSWORD as QUERY_TYPE_WRITE
A change of the password is replicated to the slaves, so it
must only be sent to the master.
2019-10-07 14:33:53 +03:00
2a7f320cf4 MXS-2713 Add test that reveals problem 2019-10-07 14:24:06 +03:00
0dce20e5e7 Merge branch '2.3' into 2.4 2019-09-27 12:30:58 +03:00
a9f07844b3 MXS-2699 Accept '_[character_set] hex' as string
The purpose is to recognize e.g. /_utf8mb4 0xD091D092D093/ as
a valid string. The rule actually accepts /id integer/, but in
case the statement is something else but an '_' immediately
followed by a character set, followed by a hex number, it will
be rejected by the server so no harm done.
2019-09-27 12:23:04 +03:00
c01ecfed05 MXS-2699 Add test that reveals other bug 2019-09-27 12:23:04 +03:00
5bbb2e239d MXS-2699 Add rule for (expr [, expr]*)
Sofar at most (expr, expr) was accepted.
2019-09-27 12:23:04 +03:00
0c2a84c3a5 MXS-2699 Add test that reveals problem 2019-09-27 12:23:04 +03:00
19487d2bfb Merge branch '2.3' into 2.4 2019-09-20 09:36:23 +03:00
aa7be1447d MXS-2688 Handle SET [ROLE|NAMES|PASSWORD|CHARACTER] explicitly
It's not correct to claim that they would modify a system variable,
so they are purely classified as QUERY_TYPE_SESSION_WRITE.
2019-09-20 09:27:38 +03:00
f587ec191d MXS-2688 Add QC operator QUERY_OP_SET
Allows RWS to unconditionally send all SET-statements to
all servers.
2019-09-20 09:27:38 +03:00
5e2d9f599b Merge branch '2.3' into 2.4 2019-09-16 09:50:05 +03:00
60c33b149c MXS-2674 Prevent read of unitialized variable 2019-09-16 09:32:47 +03:00
01ab0c8736 MXS-2553 Allow parenthesis around SELECT
With this change, a parenthesized top-level SELECT, such as
"(SELECT f FROM t)" will be fully parsed. Before this change,
the statement was classified as invalid and would thus have
been sent to the master.

With this change also statements like

    (SELECT f FROM t1) UNION (SELECT f FROM t2)

will be correctly classified, although only partially parsed.
2019-09-13 15:45:16 +03:00
7531515259 MXS-2674 Fix query classification
With these changes

  SET @saved_cs_client= @@character_set_client;

will be classified as QUERY_TYPE_USERVAR_WRITE and

  SELECT 1 AS c1 FROM t1 ORDER BY ( SELECT 1 AS c2 FROM
    t1 GROUP BY GREATEST(LAST_INSERT_ID(), t1.a) ORDER BY
      GREATEST(LAST_INSERT_ID(), t1.a) LIMIT 1);

will be classified as QUERY_TYPE_READ|QUERY_TYPE_MASTER_READ
2019-09-13 15:43:57 +03:00
9969f21414 MXS-2674 Add test that reveals bug 2019-09-13 15:31:06 +03:00
c079d1312e MXS-2674 Recognize timediff as builtin function 2019-09-12 12:38:57 +03:00
0ba779d5a2 Update 2.4.0 Change Date 2019-06-25 10:11:55 +03:00
d03e025046 MXS-2553 Allow parenthesis around SELECT
With this change, a parenthesized top-level SELECT, such as
"(SELECT f FROM t)" will be fully parsed. Before this change,
the statement was classified as invalid and would thus have
been sent to the master.

With this change also statements like

    (SELECT f FROM t1) UNION (SELECT f FROM t2)

will be correctly classified, although only partially parsed.
2019-06-13 10:42:46 +03:00
a0fcf67993 Merge branch '2.3' into develop 2019-06-12 11:29:03 +03:00
b98ff222f0 Merge branch '2.3.8' into 2.3 2019-06-12 11:26:33 +03:00
814ae196e9 qc_sqlite: Replace strncpy with memcpy
On RHEL8 the former may give rise to incorrect

    error: 'char* strncpy(char*, const char*, size_t)' destination
    unchanged after copying no bytes [-Werror=stringop-truncation]
2019-06-11 20:14:58 +03:00
1e3da20409 Merge branch '2.3' into develop 2019-06-11 13:54:51 +03:00
acc5863fe2 MXS-2442 ':N' accepted as pos. parameter in Oracle mode 2019-06-11 13:53:09 +03:00
4efa9dbeea Remove maxscale/alloc.h
The remaining contents were moved to maxbase/alloc.h.
2019-06-10 14:11:25 +03:00
ba60b92612 Merge branch '2.3' into develop 2019-06-05 14:48:43 +03:00
b8d601aab2 MXS-2250 Reveal table information for 'DESCRIBE tbl'
When a statement like 'DESCRIBE tbl' is classified, the table
name will now be available so that a router can check whether the
table is a temporary one. In that case, the statement must be sent
to the master.
2019-06-05 14:28:45 +03:00
b635cc92ab MXS-1783 Add 10.4 support
qc_mysqlembedded can now be built using the embedded library from
MariaDB 10.4.
2019-05-31 15:12:57 +03:00
2472911aac Fix qc compare.cc build error 2019-05-15 11:02:53 +03:00
f4e9f68615 Fix test_qc_comparecreate 2019-05-14 15:44:49 +03:00
de95fcc9d6 Format rest of the sources 2019-05-10 10:31:12 +03:00
24df547ac8 Make QC unit test names consistent with other tests
All the other tests have their names in lowercase.
2019-05-06 15:38:42 +03:00
fb0745e3de Merge branch '2.3' into develop 2019-05-03 13:48:57 +03:00
4aa8eac799 MXS-2457 Allow strings to be treated as fields
Before this change, if the firewall was configured to block the use
of certain columns, it could be be bypassed simply by

        > set @@sql_mode='ANSI_QUOTES';
        > select "ssn" from person;

The reason is that as the query classifier is not aware of whether
'ANSI_QUOTES' is on or not, it will not know that what above appears
to be the string "ssn", actually is the field name `ssn`. Consequently,
the select will not be blocked and the result returned in cleartext.

It's now possible to instruct the query classifier to report all strings
as fields, which will prevent the above. However, it will also mean that
there may be false positives.
2019-05-03 13:38:12 +03:00
f09d46c8e6 MXS-2457 Allow string arguments to be treated as fields
Before this change, the masking could be bypassed simply by

    > set @@sql_mode='ANSI_QUOTES';
    > select concat("ssn") from person;

The reason is that as the query classifier is not aware of whether
'ANSI_QUOTES' is on or not, it will not know that what above appears
to be the string "ssn", actually is the field name `ssn`. Consequently,
the select will not be blocked and the result returned in cleartext.

It's now possible to instruct the query classifier to report all string
arguments of functions as fields, which will prevent the above. However,
it will also mean that there may be false positives.
2019-05-03 13:38:12 +03:00
524a083203 MXS-2439 Do not classify implicit commits as commits
The type mask of CREATE, ALTER, etc. that cause an implicit commit
will no longer contain the bit QUERY_TYPE_COMMIT.

As an implicit commit does not change the transaction state as seen
by MaxScale, it does not make sense to claim that the statement is
a commit.
2019-04-18 11:19:23 +03:00
d2c71472b0 MXS-2432 Recognize RESET
RESET QUERY CACHE is reported to be a session command, which will
cause it to be sent to all servers. RESET [MASTER|SLAVE] are
classified as write, which will cause them to be sent to the master.

It could be argued that RESET [MASTER|SLAVE] should cause an error
to be sent to the client.
2019-04-12 14:51:01 +03:00
3127aa85c5 MXS-2432 Add test that reveals issue
RESET is neither parsed not tokenized, so RESET statements ends
up being sent to the master. That is fine for all but RESET QUERY
CACHE that should be sent to all servers.
2019-04-12 14:51:01 +03:00