Minor cleanup of route_single_stmt

Moved transaction statistics calculations into a member function and
placed all target type specific processing into their respective
functions.

Also inverted the connection keepalive check to also cover hinted queries.
This commit is contained in:
Markus Mäkelä
2018-07-08 00:28:16 +03:00
parent 616fb30818
commit 98e233bb33
2 changed files with 19 additions and 22 deletions

View File

@ -270,6 +270,16 @@ private:
return buflen == MYSQL_HEADER_LEN + GW_MYSQL_MAX_PACKET_LEN;
}
void update_trx_statistics()
{
if (session_trx_is_ending(m_client->session))
{
atomic_add_uint64(m_qc.is_trx_still_read_only() ?
&m_router->stats().n_ro_trx :
&m_router->stats().n_rw_trx, 1);
}
}
};
/**