From 1a293c0093bf1da68e1274ccd7dc717f8ca58264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 12 Apr 2018 19:36:34 +0300 Subject: [PATCH] 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. --- server/modules/routing/readwritesplit/rwsplit_route_stmt.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc b/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc index f7d62484f..cca0e5663 100644 --- a/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc +++ b/server/modules/routing/readwritesplit/rwsplit_route_stmt.cc @@ -168,7 +168,7 @@ route_target_t get_target_type(RWSplitSession *rses, GWBUF *buffer, 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*/ rses->load_data_state = LOAD_DATA_END;