From 9c6e15b426de3d810fe65a06fae709745a9d2eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 20 Mar 2018 14:44:48 +0200 Subject: [PATCH] MXS-1719: Fix hang on multi-statement UPDATE When a multi-statement query consisting completely of UPDATE statements is received, the packets can be received in two separate buffers. To cope with this situation, the state change into REPLY_STATE_RSET_COLDEF must only be done if the buffer contains more than a single packet. --- server/modules/routing/readwritesplit/readwritesplit.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/modules/routing/readwritesplit/readwritesplit.cc b/server/modules/routing/readwritesplit/readwritesplit.cc index e20275073..bf531c76a 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.cc +++ b/server/modules/routing/readwritesplit/readwritesplit.cc @@ -538,11 +538,10 @@ bool reply_is_complete(SRWBackend& backend, GWBUF *buffer) ss_dassert(mxs_mysql_is_ok_packet(buffer) && mxs_mysql_more_results_after_ok(buffer)); - LOG_RS(backend, REPLY_STATE_RSET_COLDEF); - backend->set_reply_state(REPLY_STATE_RSET_COLDEF); - if (have_next_packet(buffer)) { + LOG_RS(backend, REPLY_STATE_RSET_COLDEF); + backend->set_reply_state(REPLY_STATE_RSET_COLDEF); return reply_is_complete(backend, buffer); } }