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:
Markus Makela 2016-03-02 13:49:12 +02:00
parent 2a35312022
commit 2589630b8e
2 changed files with 2 additions and 1 deletions

View File

@ -647,6 +647,7 @@ static qc_query_type_t resolve_query_type(THD* thd)
break;
default:
type |= QUERY_TYPE_WRITE;
break;
}

View File

@ -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 */