Skip to content

Commit

Permalink
Merge pull request #7778 from planetscale/bp-7774
Browse files Browse the repository at this point in the history
[9.0] make sure to not log sensitive information
  • Loading branch information
shlomi-noach authored Apr 1, 2021
2 parents e92e363 + b720ad0 commit 30e2981
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion go/vt/vtgate/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ func (e *Executor) Execute(ctx context.Context, method string, safeSession *Safe
saveSessionStats(safeSession, stmtType, result, err)
if result != nil && len(result.Rows) > *warnMemoryRows {
warnings.Add("ResultsExceeded", 1)
log.Warningf("%q exceeds warning threshold of max memory rows: %v", sql, *warnMemoryRows)
piiSafeSQL, err := sqlparser.RedactSQLQuery(sql)
if err != nil {
piiSafeSQL = logStats.StmtType
}
log.Warningf("%q exceeds warning threshold of max memory rows: %v", piiSafeSQL, *warnMemoryRows)
}

logStats.Send()
Expand Down

0 comments on commit 30e2981

Please sign in to comment.