Added QUERY_TYPE_GLOBAL_WRITE for writes which don't reflect on binary log, but need to be present in every back-end server once executed.
This commit is contained in:
@ -418,14 +418,27 @@ static skygw_query_type_t resolve_query_type(
|
|||||||
* PRELOAD_KEYS, FLUSH, RESET, CREATE|ALTER|DROP SERVER
|
* PRELOAD_KEYS, FLUSH, RESET, CREATE|ALTER|DROP SERVER
|
||||||
*/
|
*/
|
||||||
if (sql_command_flags[lex->sql_command] & CF_AUTO_COMMIT_TRANS) {
|
if (sql_command_flags[lex->sql_command] & CF_AUTO_COMMIT_TRANS) {
|
||||||
|
if (lex->option_type == OPT_GLOBAL)
|
||||||
|
{
|
||||||
|
qtype = QUERY_TYPE_GLOBAL_WRITE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
qtype = QUERY_TYPE_SESSION_WRITE;
|
qtype = QUERY_TYPE_SESSION_WRITE;
|
||||||
|
}
|
||||||
goto return_here;
|
goto return_here;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Try to catch session modifications here */
|
/** Try to catch session modifications here */
|
||||||
switch (lex->sql_command) {
|
switch (lex->sql_command) {
|
||||||
case SQLCOM_CHANGE_DB:
|
|
||||||
case SQLCOM_SET_OPTION:
|
case SQLCOM_SET_OPTION:
|
||||||
|
if (lex->option_type == OPT_GLOBAL)
|
||||||
|
{
|
||||||
|
qtype = QUERY_TYPE_GLOBAL_WRITE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/**<! fall through */
|
||||||
|
case SQLCOM_CHANGE_DB:
|
||||||
qtype = QUERY_TYPE_SESSION_WRITE;
|
qtype = QUERY_TYPE_SESSION_WRITE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -33,7 +33,8 @@ typedef enum {
|
|||||||
QUERY_TYPE_LOCAL_READ, /*!< Read non-database data, execute in MaxScale */
|
QUERY_TYPE_LOCAL_READ, /*!< Read non-database data, execute in MaxScale */
|
||||||
QUERY_TYPE_READ, /*!< No updates */
|
QUERY_TYPE_READ, /*!< No updates */
|
||||||
QUERY_TYPE_WRITE, /*!< Master data will be modified */
|
QUERY_TYPE_WRITE, /*!< Master data will be modified */
|
||||||
QUERY_TYPE_SESSION_WRITE /*!< Session data will be modified */
|
QUERY_TYPE_SESSION_WRITE,/*!< Session data will be modified */
|
||||||
|
QUERY_TYPE_GLOBAL_WRITE /*!< Global system variable modification */
|
||||||
} skygw_query_type_t;
|
} skygw_query_type_t;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user