From 58373b3495ba4a5e1465c1c2c3aa50f2a9402ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 19 Dec 2017 09:33:10 +0200 Subject: [PATCH 1/2] Fix template generation The templates weren't generated for Galera nodes. --- maxscale-system-test/testconnections.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/maxscale-system-test/testconnections.cpp b/maxscale-system-test/testconnections.cpp index dcd552dfe..7c9f79cfb 100644 --- a/maxscale-system-test/testconnections.cpp +++ b/maxscale-system-test/testconnections.cpp @@ -645,12 +645,7 @@ void TestConnections::process_template(const char *template_name, const char *de mdn[0] = repl; mdn[1] = galera; int i, j; - int mdn_n = 1; - - if (galera == NULL) - { - mdn_n =1; - } + int mdn_n = galera ? 2 : 1; for (j = 0; j < mdn_n; j++) { From ba9b4a3bf60c8cdf3829c9eeb904018db91909d1 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Wed, 27 Dec 2017 10:54:12 +0200 Subject: [PATCH 2/2] MXS-1527 Do not consider sysvars to be updated in SELECT A statement like select if(@@hostname='box02','prod_mariadb02','n'); does not modify @@hostname. Hence the type mask should be QUERY_TYPE_READ|QUERY_TYPE_SYSVAR_READ and NOT QUERY_TYPE_READ|QUERY_TYPE_GSYSVAR_WRITE. --- query_classifier/qc_sqlite/qc_sqlite.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/query_classifier/qc_sqlite/qc_sqlite.c b/query_classifier/qc_sqlite/qc_sqlite.c index 438fb1489..7ee6de302 100644 --- a/query_classifier/qc_sqlite/qc_sqlite.c +++ b/query_classifier/qc_sqlite/qc_sqlite.c @@ -1023,7 +1023,10 @@ static void update_field_infos(QC_SQLITE_INFO* info, { if (zToken[1] == '@') { - if ((prev_token == TK_EQ) && (pos == QC_TOKEN_LEFT)) + // TODO: This should actually be "... && (info->operation == QUERY_OP_SET)" + // TODO: but there is no QUERY_OP_SET at the moment. + if ((prev_token == TK_EQ) && (pos == QC_TOKEN_LEFT) && + (info->operation != QUERY_OP_SELECT)) { info->type_mask |= QUERY_TYPE_GSYSVAR_WRITE; }