Make PREPARE operation explicit

The operation of the statement to be prepared is no longer
reported as the operation of the PREPARE statement.

Instead, when the type of the statement is
QUERY_TYPE_PREPARE_NAMED_STMT, the operation can be obtained
using qc_get_prepare_operation().

The qc_mysqlembedded implementation will be provided in a
subsequent commit.
This commit is contained in:
Johan Wikman
2016-10-31 13:38:18 +02:00
parent 8c20ad5cd0
commit 91e36ecaed
4 changed files with 93 additions and 3 deletions

View File

@ -116,6 +116,7 @@ typedef struct query_classifier
char* (*qc_get_affected_fields)(GWBUF* stmt);
char** (*qc_get_database_names)(GWBUF* stmt, int* size);
char* (*qc_get_prepare_name)(GWBUF* stmt);
qc_query_op_t (*qc_get_prepare_operation)(GWBUF* stmt);
} QUERY_CLASSIFIER;
/**
@ -285,6 +286,17 @@ qc_query_op_t qc_get_operation(GWBUF* stmt);
*/
char* qc_get_prepare_name(GWBUF* stmt);
/**
* Returns the operator of the prepared statement, if the statement
* is a PREPARE statement.
*
* @param stmt A buffer containing a COM_QUERY packet.
*
* @return The operator of the prepared statement, if the statement
* is a PREPARE statement; otherwise QUERY_OP_UNDEFINED.
*/
qc_query_op_t qc_get_prepare_operation(GWBUF* stmt);
/**
* Returns the tables accessed by the statement.
*