MXS-1785: Don't assume empty packet is for LDLI

When a LOAD DATA LOCAL INFILE finishes, the client sends an empty
packet. The second case when the client sends an empty packet when the
previous packet was exactly 0xffffff bytes long. These two packets were
confused which caused the internal state to temporarily flip from inactive
to ending and back to inactive.

The aforementioned flip-flopping didn't have any practical differences but
it was caught by a debug assertion.
This commit is contained in:
Markus Mäkelä
2018-04-12 19:36:34 +03:00
parent a663ea2e80
commit 1a293c0093

View File

@ -168,7 +168,7 @@ route_target_t get_target_type(RWSplitSession *rses, GWBUF *buffer,
route_target = get_route_target(rses, *command, *type, buffer->hint); route_target = get_route_target(rses, *command, *type, buffer->hint);
} }
} }
else else if (rses->load_data_state == LOAD_DATA_ACTIVE)
{ {
/** Empty packet signals end of LOAD DATA LOCAL INFILE, send it to master*/ /** Empty packet signals end of LOAD DATA LOCAL INFILE, send it to master*/
rses->load_data_state = LOAD_DATA_END; rses->load_data_state = LOAD_DATA_END;