Skip to content

Commit

Permalink
statistic: improve ipv6 for analyze job meta (#45177) (#45184)
Browse files Browse the repository at this point in the history
ref #43260
  • Loading branch information
ti-chi-bot authored Nov 6, 2023
1 parent c9c0e88 commit 4945bd8
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 @@ -450,7 +451,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 4945bd8

Please sign in to comment.