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

@ -181,6 +181,7 @@ typedef struct session
bool qualifies_for_pooling; /**< Whether this session qualifies for the connection pool */
SessionStmtQueue* last_statements; /*< The N last statements by the client */
session_close_t close_reason; /**< Reason why the session was closed */
bool load_active; /**< Data streaming state (for LOAD DATA LOCAL INFILE) */
skygw_chk_t ses_chk_tail;
} MXS_SESSION;
@ -557,4 +558,14 @@ session_dump_statements_t session_get_dump_statements();
*/
const char* session_get_close_reason(const MXS_SESSION* session);
static inline void session_set_load_active(MXS_SESSION* session, bool value)
{
session->load_active = value;
}
static inline bool session_is_load_active(const MXS_SESSION* session)
{
return session->load_active;
}
MXS_END_DECLS