diff --git a/lib/MySQL_HostGroups_Manager.cpp b/lib/MySQL_HostGroups_Manager.cpp index 7deda89b44..506ff3b31d 100644 --- a/lib/MySQL_HostGroups_Manager.cpp +++ b/lib/MySQL_HostGroups_Manager.cpp @@ -1581,7 +1581,9 @@ void MySQL_HostGroups_Manager::drop_all_idle_connections() { int i=0; for (i=0; i<(int)mscl->conns_length() ; i++) { MySQL_Connection *mc=mscl->index(i); - if (curtime > mc->creation_time + mysql_thread___connection_max_age_ms * 1000) { + unsigned long long intv = mysql_thread___connection_max_age_ms; + intv *= 1000; + if (curtime > mc->creation_time + intv) { mc=mscl->remove(0); delete mc; i--; diff --git a/lib/mysql_data_stream.cpp b/lib/mysql_data_stream.cpp index 4da7777eff..ec427000cb 100644 --- a/lib/mysql_data_stream.cpp +++ b/lib/mysql_data_stream.cpp @@ -876,7 +876,9 @@ void MySQL_Data_Stream::setDSS_STATE_QUERY_SENT_NET() { void MySQL_Data_Stream::return_MySQL_Connection_To_Pool() { MySQL_Connection *mc=myconn; mc->last_time_used=sess->thread->curtime; - if ((mysql_thread___connection_max_age_ms) && (mc->last_time_used > mc->creation_time + mysql_thread___connection_max_age_ms * 1000)) { + unsigned long long intv = mysql_thread___connection_max_age_ms; + intv *= 1000; + if ((intv) && (mc->last_time_used > mc->creation_time + intv)) { destroy_MySQL_Connection_From_Pool(true); } else { detach_connection();