Fix handling of large result packets
The RWBackend didn't know to skip the tail end of large packets.
This commit is contained in:
@ -156,6 +156,7 @@ private:
|
|||||||
bool m_local_infile_requested; /**< Whether a LOCAL INFILE was requested */
|
bool m_local_infile_requested; /**< Whether a LOCAL INFILE was requested */
|
||||||
ResponseStat m_response_stat;
|
ResponseStat m_response_stat;
|
||||||
uint64_t m_num_coldefs = 0;
|
uint64_t m_num_coldefs = 0;
|
||||||
|
bool m_skip_next = false;
|
||||||
|
|
||||||
inline bool is_opening_cursor() const
|
inline bool is_opening_cursor() const
|
||||||
{
|
{
|
||||||
|
@ -296,6 +296,17 @@ void RWBackend::process_packets(GWBUF* result)
|
|||||||
auto end = std::next(it, len);
|
auto end = std::next(it, len);
|
||||||
uint8_t cmd = *it;
|
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)
|
switch (m_reply_state)
|
||||||
{
|
{
|
||||||
case REPLY_STATE_START:
|
case REPLY_STATE_START:
|
||||||
|
Reference in New Issue
Block a user