diff --git a/include/maxscale/query_classifier.h b/include/maxscale/query_classifier.h index 72972f308..34396ba09 100644 --- a/include/maxscale/query_classifier.h +++ b/include/maxscale/query_classifier.h @@ -95,6 +95,7 @@ typedef enum qc_query_op QUERY_OP_UNDEFINED = 0, QUERY_OP_ALTER, + QUERY_OP_CALL, QUERY_OP_CHANGE_DB, QUERY_OP_CREATE, QUERY_OP_DELETE, diff --git a/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc b/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc index 4979da6c5..565e7d641 100644 --- a/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc +++ b/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc @@ -2042,6 +2042,10 @@ int32_t qc_mysql_get_operation(GWBUF* querybuf, int32_t* operation) *operation = QUERY_OP_EXECUTE; break; + case SQLCOM_CALL: + *operation = QUERY_OP_CALL; + break; + default: *operation = QUERY_OP_UNDEFINED; } diff --git a/query_classifier/qc_sqlite/qc_sqlite.cc b/query_classifier/qc_sqlite/qc_sqlite.cc index 22de68ab0..a2be5e894 100644 --- a/query_classifier/qc_sqlite/qc_sqlite.cc +++ b/query_classifier/qc_sqlite/qc_sqlite.cc @@ -2014,6 +2014,7 @@ public: m_status = QC_QUERY_PARSED; m_type_mask = QUERY_TYPE_WRITE; + m_operation = QUERY_OP_CALL; if (pExprList) { diff --git a/query_classifier/test/maxscale.test b/query_classifier/test/maxscale.test index 64f5050bc..6b9b59449 100644 --- a/query_classifier/test/maxscale.test +++ b/query_classifier/test/maxscale.test @@ -83,4 +83,7 @@ SELECT her FROM (SELECT @@server_id as her) as t WHERE her REGEXP '.*'; select * from db1.t1 union select * from db2.t2; # Names is a keyword as well -select names from t; \ No newline at end of file +select names from t; + +call p1(); +call p1(@var); \ No newline at end of file diff --git a/server/core/query_classifier.cc b/server/core/query_classifier.cc index 18fc15508..a6a70afbd 100644 --- a/server/core/query_classifier.cc +++ b/server/core/query_classifier.cc @@ -362,6 +362,9 @@ const char* qc_op_to_string(qc_query_op_t op) case QUERY_OP_ALTER: return "QUERY_OP_ALTER"; + case QUERY_OP_CALL: + return "QUERY_OP_CALL"; + case QUERY_OP_CHANGE_DB: return "QUERY_OP_CHANGE_DB";