diff --git a/include/maxscale/protocol/rwbackend.hh b/include/maxscale/protocol/rwbackend.hh index a13a3cb03..bbf8f0c2a 100644 --- a/include/maxscale/protocol/rwbackend.hh +++ b/include/maxscale/protocol/rwbackend.hh @@ -156,6 +156,7 @@ private: bool m_local_infile_requested; /**< Whether a LOCAL INFILE was requested */ ResponseStat m_response_stat; uint64_t m_num_coldefs = 0; + bool m_skip_next = false; inline bool is_opening_cursor() const { diff --git a/server/modules/protocol/MySQL/rwbackend.cc b/server/modules/protocol/MySQL/rwbackend.cc index 66e82cfb2..208192e8c 100644 --- a/server/modules/protocol/MySQL/rwbackend.cc +++ b/server/modules/protocol/MySQL/rwbackend.cc @@ -296,6 +296,17 @@ void RWBackend::process_packets(GWBUF* result) auto end = std::next(it, len); uint8_t cmd = *it; + // Ignore the tail end of a large packet large packet. Only resultsets can generate packets this large + // and we don't care what the contents are and thus it is safe to ignore it. + bool skip_next = m_skip_next; + m_skip_next = len == GW_MYSQL_MAX_PACKET_LEN; + + if (skip_next) + { + it = end; + continue; + } + switch (m_reply_state) { case REPLY_STATE_START: