MXS-3425: Fix handling of LOAD DATA LOCAL INFILE
The LOAD DATA LOCAL INFILE is handled in a way where it returns two results that both are complete: the first one with the file being requested and the second one with the final OK packet. Readwritesplit called session_book_server_response for both statements which caused the current query index to drop to -1 which in turn was unconditionally used as the buffer offset. The new check for the invalid index value will help prevent crashes in production while still allowing it to be detected while testing.
This commit is contained in:
@ -734,7 +734,7 @@ void RWSplitSession::clientReply(GWBUF* writebuf, DCB* backend_dcb)
|
||||
/** Got a complete reply, decrement expected response count */
|
||||
m_expected_responses--;
|
||||
|
||||
if (!backend->is_replaying_history())
|
||||
if (!backend->is_replaying_history() && !backend->local_infile_requested())
|
||||
{
|
||||
session_book_server_response(m_pSession, backend->backend()->server, m_expected_responses == 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user