MXS-2027: Store LOAD DATA state inside MXS_SESSION

By storing the data gathere by readwritesplit inside the session, the
protocol will be aware of the state of the LOAD DATA LOCAL INFILE
execution. This prevents misinterpretation of the data which previously
led to closed connections, effectively rendering LOAD DATA LOCAL INFILE
unusable.

This change is a temporary solution to a problem that needs to be solved
at the protocol level. The changes required to implement this are too big
to add into a bug fix release.
This commit is contained in:
Markus Mäkelä
2018-08-28 14:19:06 +03:00
parent e38e08089a
commit 5f4aa46552
5 changed files with 18 additions and 2 deletions

View File

@ -1204,6 +1204,7 @@ static void clientReply(MXS_ROUTER *instance,
{
// Server responded with an error to the LOAD DATA LOCAL INFILE
rses->load_data_state = LOAD_DATA_INACTIVE;
session_set_load_active(backend_dcb->session, true);
}
if (backend->get_reply_state() == REPLY_STATE_DONE)

View File

@ -1220,6 +1220,7 @@ bool handle_got_target(RWSplit *inst, RWSplitSession *rses,
/** The first packet contains the actual query and the server
* will respond to it */
rses->load_data_state = LOAD_DATA_ACTIVE;
session_set_load_active(rses->client_dcb->session, true);
}
else if (rses->load_data_state == LOAD_DATA_END)
{
@ -1227,6 +1228,7 @@ bool handle_got_target(RWSplit *inst, RWSplitSession *rses,
* to which the server responds with an OK or an ERR packet */
ss_dassert(gwbuf_length(querybuf) == 4);
rses->load_data_state = LOAD_DATA_INACTIVE;
session_set_load_active(rses->client_dcb->session, false);
}
}