From 03b5a634f44f78d494ec7e4ee1ffb3c5fdaf3359 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Sat, 4 Jul 2015 09:04:53 +0300 Subject: [PATCH] Fix to MXS-244: https://mariadb.atlassian.net/browse/MXS-244 Fixed buffers being only partially consumed if they contained more than one packet when a replu to a prepared statement is received. --- server/modules/routing/readwritesplit/readwritesplit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index b801d9aec..3c329f646 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -3787,7 +3787,7 @@ static GWBUF* sescmd_cursor_process_replies( dcb_close(bref->bref_dcb); *reconnect = true; if(replybuf) - gwbuf_consume(replybuf,gwbuf_length(replybuf)); + while((replybuf = gwbuf_consume(replybuf,gwbuf_length(replybuf)))); } } /** This is a response from the master and it is the "right" one. @@ -3830,7 +3830,7 @@ static GWBUF* sescmd_cursor_process_replies( skygw_log_write(LOGFILE_DEBUG,"Slave '%s' responded faster to a session command.", bref->bref_backend->backend_server->unique_name); if(replybuf) - gwbuf_free(replybuf); + while((replybuf = gwbuf_consume(replybuf,gwbuf_length(replybuf)))); return NULL; }