Fix handling of large result packets

The RWBackend didn't know to skip the tail end of large packets.
This commit is contained in:
Markus Mäkelä 2019-04-16 23:07:00 +03:00
parent e9cc79d623
commit d3bfe0a712
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
2 changed files with 12 additions and 0 deletions

View File

@ -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
{

View File

@ -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: