diff --git a/server/modules/protocol/mysql_backend.c b/server/modules/protocol/mysql_backend.c index ac36f34d8..462a77c48 100644 --- a/server/modules/protocol/mysql_backend.c +++ b/server/modules/protocol/mysql_backend.c @@ -392,13 +392,10 @@ static int gw_read_backend_event(DCB *dcb) { dcb, dcb->session))); - if (session != NULL) - { - spinlock_acquire(&session->ses_lock); - session->state = SESSION_STATE_STOPPING; - spinlock_release(&session->ses_lock); - } - ss_dassert(dcb->dcb_errhandle_called); + spinlock_acquire(&session->ses_lock); + session->state = SESSION_STATE_STOPPING; + spinlock_release(&session->ses_lock); + ss_dassert(dcb->dcb_errhandle_called); dcb_close(dcb); } rc = 1; diff --git a/server/modules/protocol/mysql_common.c b/server/modules/protocol/mysql_common.c index bfa45ed98..ce8d275b0 100644 --- a/server/modules/protocol/mysql_common.c +++ b/server/modules/protocol/mysql_common.c @@ -1767,7 +1767,7 @@ void protocol_archive_srv_command( } else /*< scan and count history commands */ { - len += 1; + len = 1; while (h1->scom_next != NULL) {