Fix RWBackend state tracking with multi-result queries
If a query returned multiple resultsets and the connection was broken between the resultsets, the backend would not know that parts of the response were already sent. This is caused by the cyclic nature of the state machine when multi-result responses are being processed. To fix the problem, the result size is tracked to know how many bytes have been sent to the client. This is a backport of the MySQLProtocol::Result::size from 2.5(develop).
This commit is contained in:
@ -240,7 +240,7 @@ public:
|
||||
*/
|
||||
bool reply_has_started() const
|
||||
{
|
||||
return m_reply_state != REPLY_STATE_START && m_reply_state != REPLY_STATE_DONE;
|
||||
return m_size > 0 && m_reply_state != REPLY_STATE_DONE;
|
||||
}
|
||||
|
||||
void process_packets(GWBUF* buffer);
|
||||
@ -269,6 +269,7 @@ private:
|
||||
bool m_large_query = false;
|
||||
bool m_skip_next = false;
|
||||
Error m_error;
|
||||
uint64_t m_size = 0;/**< Size of the response */
|
||||
|
||||
/**
|
||||
* @param it Iterator pointing to the command byte of an error packet.
|
||||
|
Reference in New Issue
Block a user