From f26203cec40a02e9d9658abf036026b1e5ea1f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 5 Oct 2017 18:30:41 +0300 Subject: [PATCH] Make each packet contiguous for RCAP_TYPE_STMT_OUTPUT As each packet is routed separately, they must be made contiguous before routing them. --- server/modules/protocol/MySQL/MySQLBackend/mysql_backend.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/modules/protocol/MySQL/MySQLBackend/mysql_backend.c b/server/modules/protocol/MySQL/MySQLBackend/mysql_backend.c index bd13c2701..df66e2b0d 100644 --- a/server/modules/protocol/MySQL/MySQLBackend/mysql_backend.c +++ b/server/modules/protocol/MySQL/MySQLBackend/mysql_backend.c @@ -922,6 +922,12 @@ gw_read_and_write(DCB *dcb) !result_collected) { stmt = modutil_get_next_MySQL_packet(&read_buffer); + + if (!GWBUF_IS_CONTIGUOUS(stmt)) + { + // Make sure the buffer is contiguous + stmt = gwbuf_make_contiguous(stmt); + } } else {