Skip to content

Commit

Permalink
*: only output log when error is non-nil (pingcap#53350)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhebox authored and terry1purcell committed May 17, 2024
1 parent f684ddc commit 8fc7a14
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/executor/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -1861,9 +1861,11 @@ func (a *ExecStmt) SummaryStmt(succ bool) {
planGenerator := func() (p string, h string, e any) {
defer func() {
e = recover()
logutil.BgLogger().Warn("fail to generate plan info",
zap.Stack("backtrace"),
zap.Any("error", e))
if e != nil {
logutil.BgLogger().Warn("fail to generate plan info",
zap.Stack("backtrace"),
zap.Any("error", e))
}
}()
p, h = getEncodedPlan(stmtCtx, !sessVars.InRestrictedSQL)
return
Expand Down

0 comments on commit 8fc7a14

Please sign in to comment.