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:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user