Added support for fine-grained query classification which is needed for configurable support for user- and system variable execution. This is partial implementation to task MAX-242. Tests passed with make -C server/modules/routing/readwritesplit/test but this is intermediate commit.
This commit is contained in:
@ -25,29 +25,39 @@ Copyright SkySQL Ab
|
||||
|
||||
EXTERN_C_BLOCK_BEGIN
|
||||
|
||||
bool allow_var_writes_to_slaves = false;
|
||||
bool allow_var_reads_from_slaves = false;
|
||||
|
||||
/**
|
||||
* Query type for skygateway.
|
||||
* The meaninful difference is where operation is done and whether master data
|
||||
* is modified
|
||||
*/
|
||||
typedef enum {
|
||||
QUERY_TYPE_UNKNOWN = 0x0000, /*< Initial value, can't be tested bitwisely */
|
||||
QUERY_TYPE_LOCAL_READ = 0x0001, /*< Read non-database data, execute in MaxScale */
|
||||
QUERY_TYPE_READ = 0x0002, /*< No updates */
|
||||
QUERY_TYPE_WRITE = 0x0004, /*< Master data will be modified */
|
||||
QUERY_TYPE_SESSION_WRITE = 0x0008, /*< Session data will be modified */
|
||||
QUERY_TYPE_GLOBAL_WRITE = 0x0010, /*< Global system variable modification */
|
||||
QUERY_TYPE_BEGIN_TRX = 0x0020, /*< BEGIN or START TRANSACTION */
|
||||
QUERY_TYPE_ENABLE_AUTOCOMMIT = 0x0040, /*< SET autocommit=1 */
|
||||
QUERY_TYPE_DISABLE_AUTOCOMMIT = 0x0080, /*< SET autocommit=0 */
|
||||
QUERY_TYPE_ROLLBACK = 0x0100, /*< ROLLBACK */
|
||||
QUERY_TYPE_COMMIT = 0x0200, /*< COMMIT */
|
||||
QUERY_TYPE_PREPARE_NAMED_STMT = 0x0400, /*< Prepared stmt with name from user */
|
||||
QUERY_TYPE_PREPARE_STMT = 0x0800, /*< Prepared stmt with id provided by server */
|
||||
QUERY_TYPE_EXEC_STMT = 0x1000, /*< Execute prepared statement */
|
||||
QUERY_TYPE_SESSION_READ = 0x2000, /*< Read session data (from master 31.8.14) */
|
||||
QUERY_TYPE_CREATE_TMP_TABLE = 0x4000, /*< Create temporary table */
|
||||
QUERY_TYPE_READ_TMP_TABLE = 0x8000 /*< Read temporary table */
|
||||
QUERY_TYPE_UNKNOWN = 0x000000, /*< Initial value, can't be tested bitwisely */
|
||||
QUERY_TYPE_LOCAL_READ = 0x000001, /*< Read non-database data, execute in MaxScale:any */
|
||||
QUERY_TYPE_READ = 0x000002, /*< Read database data:any */
|
||||
QUERY_TYPE_WRITE = 0x000004, /*< Master data will be modified:master */
|
||||
QUERY_TYPE_MASTER_READ = 0x000008, /*< Read from the master:master */
|
||||
QUERY_TYPE_SESSION_WRITE = 0x000010, /*< Session data will be modified:master or all */
|
||||
/** Not implemented yet */
|
||||
// QUERY_TYPE_USERVAR_WRITE = 0x000020, /*< Write a user variable:master or all */
|
||||
QUERY_TYPE_USERVAR_READ = 0x000040, /*< Read a user variable:master or any */
|
||||
QUERY_TYPE_SYSVAR_READ = 0x000080, /*< Read a system variable:master or any */
|
||||
/** Not implemented yet */
|
||||
// QUERY_TYPE_SYSVAR_WRITE = 0x000100, /*< Write a system variable:master or all */
|
||||
QUERY_TYPE_GSYSVAR_READ = 0x000200, /*< Read global system variable:master or any */
|
||||
QUERY_TYPE_GSYSVAR_WRITE = 0x000400, /*< Write global system variable:master or all */
|
||||
QUERY_TYPE_BEGIN_TRX = 0x000800, /*< BEGIN or START TRANSACTION */
|
||||
QUERY_TYPE_ENABLE_AUTOCOMMIT = 0x001000, /*< SET autocommit=1 */
|
||||
QUERY_TYPE_DISABLE_AUTOCOMMIT = 0x002000, /*< SET autocommit=0 */
|
||||
QUERY_TYPE_ROLLBACK = 0x004000, /*< ROLLBACK */
|
||||
QUERY_TYPE_COMMIT = 0x008000, /*< COMMIT */
|
||||
QUERY_TYPE_PREPARE_NAMED_STMT = 0x010000, /*< Prepared stmt with name from user:all */
|
||||
QUERY_TYPE_PREPARE_STMT = 0x020000, /*< Prepared stmt with id provided by server:all */
|
||||
QUERY_TYPE_EXEC_STMT = 0x040000, /*< Execute prepared statement:master or any */
|
||||
QUERY_TYPE_CREATE_TMP_TABLE = 0x080000, /*< Create temporary table:master (could be all) */
|
||||
QUERY_TYPE_READ_TMP_TABLE = 0x100000 /*< Read temporary table:master (could be any) */
|
||||
} skygw_query_type_t;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user