Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session: check redact when log compile error (#41832) #41924

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,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