diff --git a/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc b/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc index a8cdb9727..d8af03c79 100644 --- a/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc +++ b/query_classifier/qc_mysqlembedded/qc_mysqlembedded.cc @@ -647,6 +647,7 @@ static qc_query_type_t resolve_query_type(THD* thd) break; default: + type |= QUERY_TYPE_WRITE; break; } diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index 225746b32..45411e637 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -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 */