Bug #418, added functions to query classifier to detect if SET autocommit is called.

Note: this compiles but doesn't work yet properly.
This commit is contained in:
VilhoRaatikka
2014-04-09 23:43:03 +03:00
parent 5e3ec5b3c8
commit 2c17dc3edf
4 changed files with 294 additions and 209 deletions

View File

@ -29,15 +29,17 @@ EXTERN_C_BLOCK_BEGIN
* is modified
*/
typedef enum {
QUERY_TYPE_UNKNOWN = 0, /*< Couln't find out or parse error */
QUERY_TYPE_LOCAL_READ = (1<<0), /*< Read non-database data, execute in MaxScale */
QUERY_TYPE_READ = (1<<1), /*< No updates */
QUERY_TYPE_WRITE = (1<<2), /*< Master data will be modified */
QUERY_TYPE_SESSION_WRITE = (1<<3), /*< Session data will be modified */
QUERY_TYPE_GLOBAL_WRITE = (1<<4), /*< Global system variable modification */
QUERY_TYPE_BEGIN_TRX = (1<<5), /*< BEGIN or START TRANSACTION */
QUERY_TYPE_ROLLBACK = (1<<6), /*< ROLLBACK */
QUERY_TYPE_COMMIT = (1<<7), /*< COMMIT */
QUERY_TYPE_UNKNOWN = 0x00, /*< Couln't find out or parse error */
QUERY_TYPE_LOCAL_READ = 0x01, /*< Read non-database data, execute in MaxScale */
QUERY_TYPE_READ = 0x02, /*< No updates */
QUERY_TYPE_WRITE = 0x04, /*< Master data will be modified */
QUERY_TYPE_SESSION_WRITE = 0x08, /*< Session data will be modified */
QUERY_TYPE_GLOBAL_WRITE = 0x10, /*< Global system variable modification */
QUERY_TYPE_BEGIN_TRX = 0x20, /*< BEGIN or START TRANSACTION */
QUERY_TYPE_ENABLE_AUTOCOMMIT = 0x30,/*< SET autocommit=1 */
QUERY_TYPE_DISABLE_AUTOCOMMIT = 0x40,/*< SET autocommit=0 */
QUERY_TYPE_ROLLBACK = 0x50, /*< ROLLBACK */
QUERY_TYPE_COMMIT = 0x60 /*< COMMIT */
} skygw_query_type_t;
#define QUERY_IS_TYPE(mask,type) ((mask & type) == type)