Fix crash with binlogrouter

If the client protocol isn't set, the command shouldn't be either.
This commit is contained in:
Markus Makela 2016-12-12 11:55:49 +02:00
parent 0b44fe1c04
commit 03681db687

View File

@ -1056,7 +1056,7 @@ static int gw_MySQLWrite_backend(DCB *dcb, GWBUF *queue)
/** Copy the current command being executed to this backend */
MySQLProtocol *client_proto = (MySQLProtocol*)dcb->session->client_dcb->protocol;
backend_protocol->current_command = client_proto->current_command;
backend_protocol->current_command = client_proto ? client_proto->current_command : -1;
MXS_DEBUG("%lu [gw_MySQLWrite_backend] write to dcb %p "
"fd %d protocol state %s.",