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:
@ -407,6 +407,18 @@ bool session_store_stmt(MXS_SESSION *session, GWBUF *buf, const struct server *s
|
|||||||
*/
|
*/
|
||||||
bool session_take_stmt(MXS_SESSION *session, GWBUF **buffer, const struct server **target);
|
bool session_take_stmt(MXS_SESSION *session, GWBUF **buffer, const struct server **target);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Check if the session has a stored statement
|
||||||
|
*
|
||||||
|
* @param session Session to check
|
||||||
|
*
|
||||||
|
* @return True if the session has a stored statement
|
||||||
|
*/
|
||||||
|
static inline bool session_have_stmt(MXS_SESSION *session)
|
||||||
|
{
|
||||||
|
return session->stmt.buffer;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear the stored statement
|
* Clear the stored statement
|
||||||
*
|
*
|
||||||
|
@ -1196,8 +1196,11 @@ static void clientReply(MXS_ROUTER *instance,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Statement was successfully executed, free the stored statement */
|
if (session_have_stmt(backend_dcb->session))
|
||||||
session_clear_stmt(backend_dcb->session);
|
{
|
||||||
|
/** Statement was successfully executed, free the stored statement */
|
||||||
|
session_clear_stmt(backend_dcb->session);
|
||||||
|
}
|
||||||
|
|
||||||
if (reply_is_complete(backend, writebuf))
|
if (reply_is_complete(backend, writebuf))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user