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

@ -386,6 +386,31 @@ public:
*/
bool post_message(uint32_t msg_id, intptr_t arg1, intptr_t arg2);
/**
* Add a session to the sessions hashmap
*
* @param id Session id, must be unique
* @param session The session to add
* @return true if successful
*/
bool add_to_session_map(SessionsById::key_type id, SessionsById::mapped_type session);
/**
* Remove a session from the sessions hashmap
*
* @param id Session id
* @return The removed session, or NULL if not found
*/
SessionsById::mapped_type remove_from_session_map(SessionsById::key_type id);
/**
* Find a session in the sessions hashmap
*
* @param id Session id
* @return The found session, or NULL if not found
*/
SessionsById::mapped_type find_in_session_map(SessionsById::key_type id);
/**
* Broadcast a message to all worker.
*