Check before clearing statements stored in the session

If the session has no stored statements, there's no need to clear them.
This commit is contained in:
Markus Mäkelä
2017-10-06 15:28:44 +03:00
committed by Johan Wikman
parent 5d18ab86ea
commit 0a5ade8927
2 changed files with 17 additions and 2 deletions

View File

@ -1196,8 +1196,11 @@ static void clientReply(MXS_ROUTER *instance,
return;
}
/** Statement was successfully executed, free the stored statement */
session_clear_stmt(backend_dcb->session);
if (session_have_stmt(backend_dcb->session))
{
/** Statement was successfully executed, free the stored statement */
session_clear_stmt(backend_dcb->session);
}
if (reply_is_complete(backend, writebuf))
{