KILL [CONNECTION | QUERY] support, part2

MySQL sessions are added to a hasmap when created, removed when closed.
MYSQL_COM_PROCESS_KILL is now detected, the thread_id is read and the kill
command sent to all worker threads to find the correct session. If found, a
fake hangup even is created for the client dcb.

As is, this function is of little use since the client could just disconnect
itself instead. Later on, additional commands of this nature will be  added.
This commit is contained in:
Esa Korhonen
2017-05-02 10:05:19 +03:00
parent f66620c89c
commit 17f6e94cba
6 changed files with 247 additions and 60 deletions

View File

@ -413,6 +413,14 @@ bool session_take_stmt(MXS_SESSION *session, GWBUF **buffer, const struct server
*/
void session_clear_stmt(MXS_SESSION *session);
/**
* Try to kill a specific session. This function only sends messages to
* worker threads without waiting for the result.
* @param issuer The session where the command originates.
* @param target_id Target session id.
*/
void session_broadcast_kill_command(MXS_SESSION* issuer, uint32_t target_id);
/**
* @brief Convert a session to JSON
*