Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#41832
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <[email protected]>
  • Loading branch information
lance6716 authored and ti-chi-bot committed Mar 3, 2023
1 parent 36a9810 commit ad693c5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -1876,7 +1876,18 @@ func (s *session) ExecuteStmt(ctx context.Context, stmtNode ast.StmtNode) (sqlex
// Only print log message when this SQL is from the user.
// Mute the warning for internal SQLs.
if !s.sessionVars.InRestrictedSQL {
<<<<<<< HEAD
logutil.Logger(ctx).Warn("compile SQL failed", zap.Error(err), zap.String("SQL", stmtNode.Text()))
=======
if !variable.ErrUnknownSystemVar.Equal(err) {
sql := stmtNode.Text()
if s.sessionVars.EnableRedactLog {
sql = parser.Normalize(sql)
}
logutil.Logger(ctx).Warn("compile SQL failed", zap.Error(err),
zap.String("SQL", sql))
}
>>>>>>> 5ba709f9554 (session: check redact when log compile error (#41832))
}
return nil, err
}
Expand Down

0 comments on commit ad693c5

Please sign in to comment.