Skip COM_CHANGE_USER for COM_QUIT

As COM_QUIT would terminate the connection, there's no need to initiate
the session reset process. Also make sure all buffers are empty before
putting the DCB into the pool.

Added extra debug assertions for parts of the code that are related to the
COM_CHANGE_USER processing.
This commit is contained in:
Markus Mäkelä
2017-08-29 11:15:06 +03:00
parent abd99febcf
commit 866a15dafa
2 changed files with 29 additions and 2 deletions

View File

@ -1698,6 +1698,16 @@ dcb_maybe_add_persistent(DCB *dcb)
MXS_FREE(loopcallback);
}
/** Free all buffered data */
gwbuf_free(dcb->dcb_fakequeue);
gwbuf_free(dcb->dcb_readqueue);
gwbuf_free(dcb->delayq);
gwbuf_free(dcb->writeq);
dcb->dcb_fakequeue = NULL;
dcb->dcb_readqueue = NULL;
dcb->delayq = NULL;
dcb->writeq = NULL;
dcb->nextpersistent = dcb->server->persistent[dcb->thread.id];
dcb->server->persistent[dcb->thread.id] = dcb;
atomic_add(&dcb->server->stats.n_persistent, 1);