Long ~0.5MB queries blocked MaxScale.
mysql_client.c:gw_read_client_event: Fixed packet reading logic. Reading didn't work when packet exceeded read buffer size.
mysql_common.c:gw_MySQL_get_next_packet: number of bytes to be copied to continuous buffer was calculated wrong, thus resulting in broken packet.
readwritesplit.c:disabled creation of canonical query in debug build because it slows down the processing too much with long queries
This commit is contained in:
VilhoRaatikka
2014-09-13 21:16:44 +03:00
parent d8d8232f9a
commit 2012dfdd35
3 changed files with 18 additions and 13 deletions

View File

@ -1530,9 +1530,7 @@ GWBUF* gw_MySQL_get_next_packet(
{
packetbuf = NULL;
goto return_packetbuf;
}
buflen = GWBUF_LENGTH((readbuf));
}
totalbuflen = gwbuf_length(readbuf);
data = (uint8_t *)GWBUF_DATA((readbuf));
packetlen = MYSQL_GET_PACKET_LEN(data)+4;
@ -1556,6 +1554,7 @@ GWBUF* gw_MySQL_get_next_packet(
uint8_t* src = GWBUF_DATA((*p_readbuf));
size_t bytestocopy;
buflen = GWBUF_LENGTH((*p_readbuf));
bytestocopy = MIN(buflen,packetlen-nbytes_copied);
memcpy(target+nbytes_copied, src, bytestocopy);
@ -1569,7 +1568,6 @@ return_packetbuf:
return packetbuf;
}
/**
* Move <npackets> from buffer pointed to by <*p_readbuf>.
*/