Fix hang with queries larger than 2^24 bytes

Readwritesplit didn't track multi-packet queries which resulted in them
being confused for pipelined queries.
This commit is contained in:
Markus Mäkelä
2017-08-23 12:33:10 +03:00
parent 2ef9fbc47a
commit ae2b9fd30d
3 changed files with 40 additions and 11 deletions

View File

@ -681,6 +681,7 @@ RWSplitSession::RWSplitSession(RWSplit* instance, MXS_SESSION* session,
rses_closed(false),
backends(backends),
current_master(master),
large_query(false),
rses_config(instance->config()),
rses_nbackends(instance->service()->n_dbref),
load_data_state(LOAD_DATA_INACTIVE),
@ -892,7 +893,8 @@ static int routeQuery(MXS_ROUTER *instance, MXS_ROUTER_SESSION *router_session,
if (rses->query_queue == NULL &&
(rses->expected_responses == 0 ||
info.command == MYSQL_COM_STMT_FETCH ||
rses->load_data_state == LOAD_DATA_ACTIVE))
rses->load_data_state == LOAD_DATA_ACTIVE ||
rses->large_query))
{
/** No active or pending queries */
if (route_single_stmt(inst, rses, querybuf, info))