diff --git a/src/database/sql/sql.go b/src/database/sql/sql.go index 54d9e6df644..6e317144451 100644 --- a/src/database/sql/sql.go +++ b/src/database/sql/sql.go @@ -1357,6 +1357,7 @@ func (db *DB) putConn(dc *driverConn, err error, resetSession bool) { } if err != driver.ErrBadConn && dc.expired(db.maxLifetime) { + db.maxLifetimeClosed++ err = driver.ErrBadConn } if debugGetPut {