Track session state only when required

The protocol should not track the session state as the parsing is quite
expensive with the current code. This change is a workaround that enables
the parsing only when required. A proper way to handle this would be to do
all the response processing in one place thus avoiding the duplication of
work.
This commit is contained in:
Markus Mäkelä
2019-03-05 12:24:15 +02:00
parent b97976c4ee
commit 5b43940559
5 changed files with 16 additions and 2 deletions

View File

@ -447,6 +447,8 @@ static inline void prepare_for_write(DCB* dcb, GWBUF* buffer)
{
proto->collect_result = true;
}
proto->track_state = GWBUF_SHOULD_TRACK_STATE(buffer);
}
/*******************************************************************************
@ -836,7 +838,8 @@ static int gw_read_and_write(DCB* dcb)
* The OK packets sent in response to COM_STMT_PREPARE are of a different
* format so we need to detect and skip them. */
if (rcap_type_required(capabilities, RCAP_TYPE_SESSION_STATE_TRACKING)
&& !expecting_ps_response(proto))
&& !expecting_ps_response(proto)
&& proto->track_state)
{
mxs_mysql_get_session_track_info(tmp, proto);
}