Move large query processing inside RWBackend
The knowledge of which function to call can be internal to RWBackend. This make the use of the class easier as one can simply write to the backend.
This commit is contained in:
@ -75,6 +75,15 @@ uint32_t RWBackend::get_ps_handle(uint32_t id) const
|
||||
|
||||
bool RWBackend::write(GWBUF* buffer, response_type type)
|
||||
{
|
||||
uint32_t len = mxs_mysql_get_packet_len(buffer);
|
||||
bool was_large_query = m_large_query;
|
||||
m_large_query = len == MYSQL_PACKET_LENGTH_MAX;
|
||||
|
||||
if (was_large_query)
|
||||
{
|
||||
return mxs::Backend::write(buffer, Backend::NO_RESPONSE);
|
||||
}
|
||||
|
||||
if (type == mxs::Backend::EXPECT_RESPONSE)
|
||||
{
|
||||
/** The server will reply to this command */
|
||||
|
Reference in New Issue
Block a user