Unknown SQL commands are treated as writes
This will prevent any possible damage to a slave by new or unexpected commands.
This commit is contained in:
parent
2a35312022
commit
2589630b8e
@ -647,6 +647,7 @@ static qc_query_type_t resolve_query_type(THD* thd)
|
||||
break;
|
||||
|
||||
default:
|
||||
type |= QUERY_TYPE_WRITE;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1438,7 +1438,7 @@ static route_target_t get_route_target(ROUTER_CLIENT_SES *rses,
|
||||
/**
|
||||
* Hints may affect on routing of the following queries
|
||||
*/
|
||||
else if (!trx_active && !load_active &&
|
||||
else if (!trx_active && !load_active && !QUERY_IS_TYPE(qtype, QUERY_TYPE_WRITE) &&
|
||||
(QUERY_IS_TYPE(qtype, QUERY_TYPE_READ) || /*< any SELECT */
|
||||
QUERY_IS_TYPE(qtype, QUERY_TYPE_SHOW_TABLES) || /*< 'SHOW TABLES' */
|
||||
QUERY_IS_TYPE(qtype, QUERY_TYPE_USERVAR_READ)|| /*< read user var */
|
||||
|
Loading…
x
Reference in New Issue
Block a user