Merge branch '2.1.7' into develop-2.1-merge

This commit is contained in:
Johan Wikman
2017-09-12 11:08:02 +03:00
28 changed files with 367 additions and 90 deletions

View File

@ -354,7 +354,8 @@ static inline bool MYSQL_IS_ERROR_PACKET(const uint8_t* header)
static inline bool MYSQL_IS_COM_QUIT(const uint8_t* header)
{
return MYSQL_GET_COMMAND(header) == MYSQL_COM_QUIT;
return MYSQL_GET_COMMAND(header) == MYSQL_COM_QUIT &&
MYSQL_GET_PAYLOAD_LEN(header) == 1;
}
static inline bool MYSQL_IS_COM_INIT_DB(const uint8_t* header)

View File

@ -57,10 +57,12 @@ typedef struct server_params
*/
typedef struct
{
int n_connections; /**< Number of connections */
int n_current; /**< Current connections */
int n_current_ops; /**< Current active operations */
int n_persistent; /**< Current persistent pool */
int n_connections; /**< Number of connections */
int n_current; /**< Current connections */
int n_current_ops; /**< Current active operations */
int n_persistent; /**< Current persistent pool */
uint64_t n_new_conn; /**< Times the current pool was empty */
uint64_t n_from_pool; /**< Times when a connection was available from the pool */
} SERVER_STATS;
/**

View File

@ -152,6 +152,7 @@ typedef struct session
GWBUF *buffer; /**< Buffer containing the statement */
const struct server *target; /**< Where the statement was sent */
} stmt; /**< Current statement being executed */
bool qualifies_for_pooling; /**< Whether this session qualifies for the connection pool */
skygw_chk_t ses_chk_tail;
} MXS_SESSION;
@ -441,6 +442,20 @@ json_t* session_to_json(const MXS_SESSION *session, const char* host);
*/
json_t* session_list_to_json(const char* host);
/**
* Qualify the session for connection pooling
*
* @param session Session to qualify
*/
void session_qualify_for_pool(MXS_SESSION* session);
/**
* Check if the session qualifies for connection pooling
*
* @param session
*/
bool session_valid_for_pool(const MXS_SESSION* session);
/**
* @brief Return the session of the dcb currently being processed
* by the calling thread.