Fix parsing of non-query packets

Packets that do not contain SQL should not be parsed.
This commit is contained in:
Markus Mäkelä 2019-03-13 15:44:02 +02:00
parent 040562f718
commit b537176248
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -241,14 +241,17 @@ bool RWSplitSession::route_stored_query()
GWBUF* temp_storage = m_query_queue;
m_query_queue = NULL;
// The query needs to be explicitly parsed as it was processed multiple times
qc_parse(query_queue, QC_COLLECT_ALL);
// TODO: Move the handling of queued queries to the client protocol
// TODO: module where the command tracking is done automatically.
uint8_t cmd = mxs_mysql_get_command(query_queue);
mysql_protocol_set_current_command(m_client, (mxs_mysql_cmd_t)cmd);
if (cmd == MXS_COM_QUERY || cmd == MXS_COM_STMT_PREPARE)
{
// The query needs to be explicitly parsed as it was processed multiple times
qc_parse(query_queue, QC_COLLECT_ALL);
}
if (!routeQuery(query_queue))
{
rval = false;