Merge pull request #3529 from sysown/v2.x-3502

Closes #3502: ProxySQL crashed due to with assert for 'mybe' being null
pull/3631/head
René Cannaò 5 years ago committed by GitHub
commit 2d670897df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1352,9 +1352,16 @@ void MySQL_Data_Stream::return_MySQL_Connection_To_Pool() {
unsigned long long intv = mysql_thread___connection_max_age_ms;
intv *= 1000;
if (
( (intv) && (mc->last_time_used > mc->creation_time + intv) )
(( (intv) && (mc->last_time_used > mc->creation_time + intv) )
||
( mc->local_stmts->get_num_backend_stmts() > (unsigned int)GloMTH->variables.max_stmts_per_connection )
( mc->local_stmts->get_num_backend_stmts() > (unsigned int)GloMTH->variables.max_stmts_per_connection ))
&&
// NOTE: If the current session if in 'PINGING_SERVER' status, there is
// no need to reset the session. The destruction and creation of a new
// session in case this session has exceeded the time specified by
// 'connection_max_age_ms' will be deferred to the next time the session
// is used outside 'PINGING_SERVER' operation. For more context see #3502.
sess->status != PINGING_SERVER
) {
if (mysql_thread___reset_connection_algorithm == 2) {
sess->create_new_session_and_reset_connection(this);

Loading…
Cancel
Save