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:
@ -116,9 +116,26 @@ bool mxs_worker_post_message(MXS_WORKER* worker, uint32_t msg_id, intptr_t arg1,
|
||||
*/
|
||||
size_t mxs_worker_broadcast_message(uint32_t msg_id, intptr_t arg1, intptr_t arg2);
|
||||
|
||||
// These automatically act on the currently executing worker thread. Not implemented yet.
|
||||
void mxs_add_to_session_map(uint32_t id, MXS_SESSION* session);
|
||||
void mxs_remove_from_session_map(uint32_t id);
|
||||
/**
|
||||
* Add a session to the current worker's session map.
|
||||
* @param id With which id to add. Typically session->ses_id.
|
||||
* @param session Session to add.
|
||||
* @return true if successful, false if id already existed in map.
|
||||
*/
|
||||
bool mxs_add_to_session_map(uint32_t id, MXS_SESSION* session);
|
||||
|
||||
/**
|
||||
* Remove a session from the current worker's session map.
|
||||
* @param id Which id to remove.
|
||||
* @return The removed session or NULL if not found.
|
||||
*/
|
||||
MXS_SESSION* mxs_remove_from_session_map(uint32_t id);
|
||||
|
||||
/**
|
||||
* Find a session in the current worker's session map.
|
||||
* @param id Which id to find.
|
||||
* @return The found session or NULL if not found.
|
||||
*/
|
||||
MXS_SESSION* mxs_find_in_session_map(uint32_t id);
|
||||
|
||||
MXS_END_DECLS
|
||||
|
Reference in New Issue
Block a user