Skip to content

Commit 9c9027d

Browse files
authored
statistic: improve ipv6 for analyze job meta (#45177) (#45185)
ref #43260
1 parent fc4edaf commit 9c9027d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

executor/analyze.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"context"
1919
"fmt"
2020
"math"
21+
"net"
2122
"strconv"
2223
"strings"
2324
"sync/atomic"
@@ -465,7 +466,7 @@ func AddNewAnalyzeJob(ctx sessionctx.Context, job *statistics.AnalyzeJob) {
465466
logutil.BgLogger().Error("failed to get server info", zap.Error(err))
466467
instance = "unknown"
467468
} else {
468-
instance = fmt.Sprintf("%s:%d", serverInfo.IP, serverInfo.Port)
469+
instance = net.JoinHostPort(serverInfo.IP, strconv.Itoa(int(serverInfo.Port)))
469470
}
470471
statsHandle := domain.GetDomain(ctx).StatsHandle()
471472
err = statsHandle.InsertAnalyzeJob(job, instance, ctx.GetSessionVars().ConnectionID)

0 commit comments

Comments
 (0)