Skip to content

Commit 9c89227

Browse files
authored
*: only output log when error is non-nil (#53350)
close #53349
1 parent 5d990c6 commit 9c89227

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkg/executor/adapter.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -1861,9 +1861,11 @@ func (a *ExecStmt) SummaryStmt(succ bool) {
18611861
planGenerator := func() (p string, h string, e any) {
18621862
defer func() {
18631863
e = recover()
1864-
logutil.BgLogger().Warn("fail to generate plan info",
1865-
zap.Stack("backtrace"),
1866-
zap.Any("error", e))
1864+
if e != nil {
1865+
logutil.BgLogger().Warn("fail to generate plan info",
1866+
zap.Stack("backtrace"),
1867+
zap.Any("error", e))
1868+
}
18671869
}()
18681870
p, h = getEncodedPlan(stmtCtx, !sessVars.InRestrictedSQL)
18691871
return

0 commit comments

Comments
 (0)