query_classifier.cc

resolve_query_type, traverse through the list of items of thd->free_list, identify functions and reason query type according to the function type. This phase can only increase the restrictiviness level of the query.

query_classifier.h
        Added new query type QUERY_TYPE_LOCAL_READ, for functions that can be executed in Maxscale. This type is the least restrict
ive query type. It is not used currently.

testmain.c
	Added a few test cases and fixed expected return values for query type tests.

readwritesplit.c
	polish

skygw_debug.h
	Added string macro for Item types.
This commit is contained in:
vraatikka
2013-10-25 11:55:45 +03:00
parent 241a0a6175
commit f32cfe8546
5 changed files with 240 additions and 30 deletions

View File

@ -25,12 +25,14 @@ EXTERN_C_BLOCK_BEGIN
/**
* Query type for skygateway.
* The meaninful difference is whether master data was modified
* The meaninful difference is where operation is done and whether master data
* is modified
*/
typedef enum {
QUERY_TYPE_UNKNOWN = 7, /*!< Couln't find out or parse error */
QUERY_TYPE_WRITE, /*!< Master data will be modified */
QUERY_TYPE_LOCAL_READ, /*!< Read non-database data, execute in MaxScale */
QUERY_TYPE_READ, /*!< No updates */
QUERY_TYPE_WRITE, /*!< Master data will be modified */
QUERY_TYPE_SESSION_WRITE /*!< Session data will be modified */
} skygw_query_type_t;