MXS-1828: Simplify LOAD DATA LOCAL INFILE handling

By relying on the server to tell us that it is requesting the loading of a
local infile, we can remove one state from the state machine that governs
the loading of local files. It also removes the need to handle error and
success cases separately.

A side-effect of this change is that execution of multi-statement LOAD
DATA LOCAL INFILE no longer hangs. This is done by checking whether the
completion of one command initiates a new load.

The current code recursively checks the reply state and clones the
buffers. Neither of these are required nor should they be done but
refactoring the code is to be done in a separate commit.

Added two helper functions that are used to detect requests for local
infiles and to extract the total packet length from a non-contiguous
GWBUF.
This commit is contained in:
Markus Mäkelä
2018-05-16 17:41:55 +03:00
parent 35f2382263
commit 91cc5b1e89
8 changed files with 67 additions and 27 deletions

View File

@ -817,15 +817,6 @@ QueryClassifier::handle_multi_temp_and_load(QueryClassifier::current_target_t cu
{
append_load_data_sent(querybuf);
}
else if (is_packet_a_query(packet_type))
{
qc_query_op_t queryop = qc_get_operation(querybuf);
if (queryop == QUERY_OP_LOAD)
{
set_load_data_state(QueryClassifier::LOAD_DATA_START);
reset_load_data_sent();
}
}
return rv;
}