MXS-2066: Reset resultset collection by default

The collection of resultsets needs to be disabled by default when a
response is received to cover the cases where an error is returned.

The collection of results should also not be set for queries that do not
generate any responses.
This commit is contained in:
Markus Mäkelä 2018-09-21 10:26:30 +03:00
parent 60915f847f
commit d55c07dc2e
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
2 changed files with 12 additions and 8 deletions

View File

@ -836,14 +836,14 @@ gw_read_and_write(DCB *dcb)
result_collected = true;
}
else if (expecting_ps_response(proto) &&
mxs_mysql_is_prep_stmt_ok(read_buffer))
mxs_mysql_is_prep_stmt_ok(read_buffer) &&
!complete_ps_response(read_buffer))
{
dcb_readq_prepend(dcb, read_buffer);
return 0;
}
else
{
if (!complete_ps_response(read_buffer))
{
dcb_readq_prepend(dcb, read_buffer);
return 0;
}
// Collected the complete result
proto->collect_result = false;
result_collected = true;

View File

@ -344,7 +344,11 @@ bool route_session_write(RWSplitSession *rses, GWBUF *querybuf,
bool expecting_response = mxs_mysql_command_will_respond(command);
int nsucc = 0;
uint64_t lowest_pos = id;
gwbuf_set_type(querybuf, GWBUF_TYPE_COLLECT_RESULT);
if (expecting_response)
{
gwbuf_set_type(querybuf, GWBUF_TYPE_COLLECT_RESULT);
}
if (qc_query_is_type(type, QUERY_TYPE_PREPARE_NAMED_STMT) ||
qc_query_is_type(type, QUERY_TYPE_PREPARE_STMT))