Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CbcWestwolf committed Jun 16, 2022
1 parent 67ff2ad commit 1015d53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ func (s *Server) SetMaxConnections(newMaxConnections uint32) error {
conns := len(s.clients)
s.rwlock.RUnlock()

if conns >= int(newMaxConnections) {
if conns > int(newMaxConnections) {
logutil.BgLogger().Error("Current connections number exceeds the setting value",
zap.Uint32("max connections", newMaxConnections), zap.Error(errConCount))
return errConCount
Expand Down
2 changes: 1 addition & 1 deletion sessionctx/variable/tidb_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,6 @@ var (
GetMemQuotaAnalyze func() int64 = nil
// SetStatsCacheCapacity is the func registered by domain to set statsCache memory quota.
SetStatsCacheCapacity atomic.Value
// SetMaxConnections is the func registered by derver to set the value of max_connections.
// SetMaxConnections is the func registered by server to set the value of max_connections.
SetMaxConnections func(newMaxConnections uint32) error = nil
)

0 comments on commit 1015d53

Please sign in to comment.