Fix debug assertion in mysql_backend

The backend read function used a NULL GWBUF with gwbuf_length.
This commit is contained in:
Markus Mäkelä 2019-05-21 12:29:37 +03:00
parent c4fff21909
commit 0c19d1ea03
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -788,7 +788,7 @@ static int gw_read_and_write(DCB* dcb)
{
GWBUF* read_buffer = NULL;
MXS_SESSION* session = dcb->session;
int nbytes_read;
int nbytes_read = 0;
int return_code = 0;
/* read available backend data */
@ -800,7 +800,11 @@ static int gw_read_and_write(DCB* dcb)
return 0;
}
nbytes_read = gwbuf_length(read_buffer);
if (read_buffer)
{
nbytes_read = gwbuf_length(read_buffer);
}
if (nbytes_read == 0)
{
mxb_assert(read_buffer == NULL);