diff --git a/include/maxscale/query_classifier.h b/include/maxscale/query_classifier.h index 6ce242303..f76b4dabf 100644 --- a/include/maxscale/query_classifier.h +++ b/include/maxscale/query_classifier.h @@ -121,6 +121,7 @@ typedef enum qc_query_op QUERY_OP_LOAD, QUERY_OP_REVOKE, QUERY_OP_SELECT, + QUERY_OP_SET, QUERY_OP_SHOW, QUERY_OP_TRUNCATE, QUERY_OP_UPDATE, diff --git a/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc b/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc index 019dc699f..001090196 100644 --- a/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc +++ b/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc @@ -2065,6 +2065,10 @@ int32_t qc_mysql_get_operation(GWBUF* querybuf, int32_t* operation) *operation = QUERY_OP_REVOKE; break; + case SQLCOM_SET_OPTION: + *operation = QUERY_OP_SET; + break; + case SQLCOM_SHOW_CREATE: case SQLCOM_SHOW_CREATE_DB: case SQLCOM_SHOW_CREATE_FUNC: diff --git a/query_classifier/qc_sqlite/qc_sqlite.cc b/query_classifier/qc_sqlite/qc_sqlite.cc index 670628234..11cd1a4af 100644 --- a/query_classifier/qc_sqlite/qc_sqlite.cc +++ b/query_classifier/qc_sqlite/qc_sqlite.cc @@ -2651,6 +2651,7 @@ public: case TK_SET: m_status = QC_QUERY_TOKENIZED; m_type_mask = QUERY_TYPE_GSYSVAR_WRITE; + m_operation = QUERY_OP_SET; break; case TK_SHOW: @@ -2883,6 +2884,7 @@ public: mxb_assert(this_thread.initialized); m_status = QC_QUERY_PARSED; + m_operation = QUERY_OP_SET; // There will be no SET in case of Oracle's "var := 1". m_type_mask = 0; // Reset what was set in maxscaleKeyword switch (kind) diff --git a/query_classifier/test/maxscale.test b/query_classifier/test/maxscale.test index 2a5758211..f757b164d 100644 --- a/query_classifier/test/maxscale.test +++ b/query_classifier/test/maxscale.test @@ -129,3 +129,6 @@ XA PREPARE 'xid'; XA COMMIT 'xid'; XA ROLLBACK 'xid' XA RECOVER 'xid'; + +# MXS-2688 +SET @saved_cs_client= @@character_set_client; diff --git a/server/core/query_classifier.cc b/server/core/query_classifier.cc index 665d57d64..af682bc3b 100644 --- a/server/core/query_classifier.cc +++ b/server/core/query_classifier.cc @@ -855,6 +855,9 @@ const char* qc_op_to_string(qc_query_op_t op) case QUERY_OP_SELECT: return "QUERY_OP_SELECT"; + case QUERY_OP_SET: + return "QUERY_OP_SET"; + case QUERY_OP_SHOW: return "QUERY_OP_SHOW";