MXS-1502: Add have_session_commands helper function

The function conveys the meaning of the call better than using
session_command_count to check whether there are session commands to be
executed.
This commit is contained in:
Markus Mäkelä
2018-03-30 08:40:01 +03:00
parent 7d4f37d25b
commit 319122e621
6 changed files with 21 additions and 11 deletions

View File

@ -431,7 +431,7 @@ int32_t SchemaRouterSession::routeQuery(GWBUF* pPacket)
MXS_INFO("Route query to \t%s:%d <", bref->backend()->server->name, bref->backend()->server->port);
if (bref->session_command_count())
if (bref->have_session_commands())
{
/** Store current statement if execution of the previous
* session command hasn't been completed. */
@ -490,7 +490,7 @@ void SchemaRouterSession::handle_mapping_reply(SSRBackend& bref, GWBUF** pPacket
void SchemaRouterSession::process_sescmd_response(SSRBackend& bref, GWBUF** ppPacket)
{
if (bref->session_command_count())
if (bref->have_session_commands())
{
/** We are executing a session command */
if (GWBUF_IS_TYPE_SESCMD_RESPONSE((*ppPacket)))