From c0ebf663e3611374f5425634d4d0ce6ebd40830a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 22 Nov 2018 14:42:26 +0200 Subject: [PATCH 1/5] Make the error message a const char* const This prevents linker errors if the source files are used directly. --- connectors/cdc-connector/cdc_connector.cpp | 2 ++ connectors/cdc-connector/cdc_connector.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/connectors/cdc-connector/cdc_connector.cpp b/connectors/cdc-connector/cdc_connector.cpp index 6391aa3ae..a4b57abe6 100644 --- a/connectors/cdc-connector/cdc_connector.cpp +++ b/connectors/cdc-connector/cdc_connector.cpp @@ -169,6 +169,8 @@ template <> void Closer::close(int fd) namespace CDC { +const char* const TIMEOUT = "Request timed out"; + /** * Public functions */ diff --git a/connectors/cdc-connector/cdc_connector.h b/connectors/cdc-connector/cdc_connector.h index b44408d4a..48510853e 100644 --- a/connectors/cdc-connector/cdc_connector.h +++ b/connectors/cdc-connector/cdc_connector.h @@ -32,7 +32,7 @@ namespace CDC // The error strings returned by the getError library. These can be used to // check for the most common errors (which right now is only the timeout). -static const char* TIMEOUT = "Request timed out"; +extern const char* const TIMEOUT; // The typedef for the Row type class Row; From d9faea4979c454c2b3b8bb099140821f0234039c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 23 Nov 2018 22:58:34 +0200 Subject: [PATCH 2/5] Fix -Wshadow warnings The cdc_connector.h won't built with -Wshadow if the variable and method names match. --- connectors/cdc-connector/cdc_connector.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/connectors/cdc-connector/cdc_connector.h b/connectors/cdc-connector/cdc_connector.h index 48510853e..0899b9cbb 100644 --- a/connectors/cdc-connector/cdc_connector.h +++ b/connectors/cdc-connector/cdc_connector.h @@ -118,14 +118,14 @@ public: */ ValueMap fields() const { - ValueMap fields; + ValueMap flds; for (size_t i = 0; i < m_keys->size(); i++) { - fields[(*m_keys)[i]] = (*m_types)[i]; + flds[(*m_keys)[i]] = (*m_types)[i]; } - return fields; + return flds; } private: From a456168fd029aaea57be6fd3de58dec0fee4946d Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Tue, 8 Jan 2019 20:22:05 +0200 Subject: [PATCH 3/5] MXS-2248 Add test that reveals problem --- query_classifier/test/maxscale.test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/query_classifier/test/maxscale.test b/query_classifier/test/maxscale.test index 693961846..9c8e9825e 100644 --- a/query_classifier/test/maxscale.test +++ b/query_classifier/test/maxscale.test @@ -118,3 +118,6 @@ SET STATEMENT max_statement_time=30 FOR UPDATE tbl SET a = 42; # MXS-2242 SELECT X(coordinates), Y(coordinates), ST_X(coordinates), ST_Y(coordinates) FROM data; + +# MXS-2248 +SELECT curdate() + interval '60' day; From e64b034334b42ece7282bdd28111b7b58db58ef5 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Tue, 8 Jan 2019 20:23:21 +0200 Subject: [PATCH 4/5] MXS-2248 Add change that fixes the problem Any kind of expression is legal after INTERVAL. --- query_classifier/qc_sqlite/sqlite-src-3110100/src/parse.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/query_classifier/qc_sqlite/sqlite-src-3110100/src/parse.y b/query_classifier/qc_sqlite/sqlite-src-3110100/src/parse.y index 9310d4d38..d6a8eab66 100644 --- a/query_classifier/qc_sqlite/sqlite-src-3110100/src/parse.y +++ b/query_classifier/qc_sqlite/sqlite-src-3110100/src/parse.y @@ -2110,10 +2110,10 @@ expr(A) ::= expr(X) BITAND|BITOR|LSHIFT|RSHIFT(OP) expr(Y). expr(A) ::= expr(X) PLUS|MINUS(OP) expr(Y). {spanBinaryExpr(&A,pParse,@OP,&X,&Y);} %ifdef MAXSCALE -expr(A) ::= INTERVAL INTEGER(X) id. { +expr(A) ::= INTERVAL expr(X) id. { // Here we could check that id is one of MICROSECOND, SECOND, MINUTE // HOUR, DAY, WEEK, etc. - spanExpr(&A, pParse, @X, &X); + A=X; // We simply ignore 'INTERVAL' } %endif expr(A) ::= expr(X) STAR|SLASH|REM(OP) expr(Y). From 27b3ab28e0bb9c01a8af374e2c004f6393836720 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Wed, 9 Jan 2019 09:13:07 +0200 Subject: [PATCH 5/5] Update 2.2.19 release notes --- Documentation/Release-Notes/MaxScale-2.2.19-Release-Notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/Release-Notes/MaxScale-2.2.19-Release-Notes.md b/Documentation/Release-Notes/MaxScale-2.2.19-Release-Notes.md index 0b5d80166..498339da5 100644 --- a/Documentation/Release-Notes/MaxScale-2.2.19-Release-Notes.md +++ b/Documentation/Release-Notes/MaxScale-2.2.19-Release-Notes.md @@ -10,6 +10,7 @@ report on [our Jira](https://jira.mariadb.org/projects/MXS). ## Bug fixes +* [MXS-2248](https://jira.mariadb.org/browse/MXS-2248) INSERT sent to all nodes * [MXS-2242](https://jira.mariadb.org/browse/MXS-2242) MaxScale does not recognize builtin read-only functions * [MXS-2238](https://jira.mariadb.org/browse/MXS-2238) MaxScale fails to send large CDC schemas * [MXS-2234](https://jira.mariadb.org/browse/MXS-2234) Add extra info to log when MaxScale loads persisted configuration files