Skip to content

Commit

Permalink
statistic: improve ipv6 for analyze job meta (#45177)
Browse files Browse the repository at this point in the history
ref #43260
  • Loading branch information
hawkingrei authored Jul 5, 2023
1 parent e76a3f3 commit db38184
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion executor/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"fmt"
"math"
"net"
"strconv"
"strings"
"sync/atomic"
Expand Down Expand Up @@ -466,7 +467,7 @@ func AddNewAnalyzeJob(ctx sessionctx.Context, job *statistics.AnalyzeJob) {
logutil.BgLogger().Error("failed to get server info", zap.Error(err))
instance = "unknown"
} else {
instance = fmt.Sprintf("%s:%d", serverInfo.IP, serverInfo.Port)
instance = net.JoinHostPort(serverInfo.IP, strconv.Itoa(int(serverInfo.Port)))
}
statsHandle := domain.GetDomain(ctx).StatsHandle()
err = statsHandle.InsertAnalyzeJob(job, instance, ctx.GetSessionVars().ConnectionID)
Expand Down

0 comments on commit db38184

Please sign in to comment.