diff --git a/include/MySQL_Session.h b/include/MySQL_Session.h index 424d7d694..e0f569fd6 100644 --- a/include/MySQL_Session.h +++ b/include/MySQL_Session.h @@ -130,9 +130,21 @@ class MySQL_Session bool handler_CommitRollback(PtrSize_t *); bool handler_SetAutocommit(PtrSize_t *); /** - * @brief Performs the cleanup of current session state, and the required operations to the supplied - * 'MySQL_Data_Stream' required for processing further queries. - * @param The 'MySQL_Data_Stream' which executed the previous query and which status should be updated. + * @brief Should execute most of the commands executed when a request is finalized. + * @details Cleanup of current session state, and required operations to the supplied 'MySQL_Data_Stream' + * for further queries processing. Takes care of the following actions: + * - Update the status of the backend connection (if supplied), with previous query actions. + * - Log the query for the required statuses. + * - Cleanup the previous Query_Processor output. + * - Free the resources of the backend connection (if supplied). + * - Reset all the required session status flags. E.g: + * + status + * + client_myds::DSS + * + started_sending_data_to_client + * + previous_hostgroup + * NOTE: Should become the place to hook other functions. + * @param myds If not null, should point to a MySQL_Data_Stream (backend connection) which connection status + * should be updated, and previous query resources cleanup. */ void RequestEnd(MySQL_Data_Stream *); void LogQuery(MySQL_Data_Stream *); diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index 55a331c00..790c16746 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -2480,8 +2480,6 @@ bool MySQL_Session::handler_again___status_CHANGING_CHARSET(int *_rc) { client_myds->myprot.generate_pkt_ERR(true,NULL,NULL,1,mysql_errno(myconn->mysql),sqlstate,mysql_error(myconn->mysql)); myds->destroy_MySQL_Connection_From_Pool(true); myds->fd=0; - status=WAITING_CLIENT_DATA; - client_myds->DSS=STATE_SLEEP; RequestEnd(myds); } } else { @@ -7466,8 +7464,6 @@ void MySQL_Session::LogQuery(MySQL_Data_Stream *myds) { } } } -// this should execute most of the commands executed when a request is finalized -// this should become the place to hook other functions void MySQL_Session::RequestEnd(MySQL_Data_Stream *myds) { // check if multiplexing needs to be disabled char *qdt = NULL;