MXS-1624 Make the QC info object explicit
The query classifier stores information about the statement carried by a GWBUF in the GWBUF itself. We need to be able to store that object out side the lifetime of the GWBUF. So, we require that a query classifier is capable of duplicating references to that object.
This commit is contained in:
@ -17,7 +17,7 @@
|
||||
|
||||
MXS_BEGIN_DECLS
|
||||
|
||||
#define MXS_QUERY_CLASSIFIER_VERSION {2, 0, 0}
|
||||
#define MXS_QUERY_CLASSIFIER_VERSION {3, 0, 0}
|
||||
|
||||
/**
|
||||
* qc_init_kind_t specifies what kind of initialization should be performed.
|
||||
@ -155,6 +155,14 @@ typedef enum qc_result
|
||||
QC_RESULT_ERROR
|
||||
} qc_result_t;
|
||||
|
||||
/**
|
||||
* QC_STMT_INFO is an opaque type where the query classifier stores
|
||||
* information about a statement.
|
||||
*/
|
||||
typedef struct qc_stmt_info
|
||||
{
|
||||
} QC_STMT_INFO;
|
||||
|
||||
/**
|
||||
* QUERY_CLASSIFIER defines the object a query classifier plugin must
|
||||
* implement and return.
|
||||
@ -406,6 +414,16 @@ typedef struct query_classifier
|
||||
* @return QC_RESULT_OK if @sql_mode is valid, otherwise QC_RESULT_ERROR.
|
||||
*/
|
||||
int32_t (*qc_set_sql_mode)(qc_sql_mode_t sql_mode);
|
||||
|
||||
/**
|
||||
* Dups the provided info object. After having been dupped, the info object
|
||||
* can be stored on another GWBUF.
|
||||
*
|
||||
* @param info The info to be dupped.
|
||||
*
|
||||
* @return The same info that was provided as argument.
|
||||
*/
|
||||
QC_STMT_INFO* (*qc_dup)(QC_STMT_INFO* info);
|
||||
} QUERY_CLASSIFIER;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user