From 17a3f3df663fdd18f4615fc58e56630055b45083 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Wed, 5 Jul 2023 17:27:44 +0800 Subject: [PATCH] This is an automated cherry-pick of #45177 Signed-off-by: ti-chi-bot --- executor/analyze.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/executor/analyze.go b/executor/analyze.go index b0f55eb592561..97a70c497f827 100644 --- a/executor/analyze.go +++ b/executor/analyze.go @@ -19,8 +19,12 @@ import ( "context" "fmt" "math" +<<<<<<< HEAD "math/rand" "sort" +======= + "net" +>>>>>>> db381848680 (statistic: improve ipv6 for analyze job meta (#45177)) "strconv" "strings" "sync" @@ -2489,7 +2493,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)