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:
@ -156,7 +156,6 @@ public:
|
||||
enum load_data_state_t
|
||||
{
|
||||
LOAD_DATA_INACTIVE, /**< Not active */
|
||||
LOAD_DATA_START, /**< Current query starts a load */
|
||||
LOAD_DATA_ACTIVE, /**< Load is active */
|
||||
LOAD_DATA_END /**< Current query contains an empty packet that ends the load */
|
||||
};
|
||||
@ -200,6 +199,12 @@ public:
|
||||
|
||||
void set_load_data_state(load_data_state_t state)
|
||||
{
|
||||
if (state == LOAD_DATA_ACTIVE)
|
||||
{
|
||||
ss_dassert(m_load_data_state == LOAD_DATA_INACTIVE);
|
||||
reset_load_data_sent();
|
||||
}
|
||||
|
||||
m_load_data_state = state;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user