Skip to content

Commit

Permalink
server: normalize SQL of execute command in logs when redaction enabled
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Yu <jackysp@gmail.com>
  • Loading branch information
jackysp committed Apr 7, 2023
1 parent 566c3f6 commit 72e079c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/conn_stmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import (
"github.com/pingcap/errors"
"github.com/pingcap/tidb/expression"
"github.com/pingcap/tidb/kv"
"github.com/pingcap/tidb/parser"
"github.com/pingcap/tidb/parser/ast"
"github.com/pingcap/tidb/parser/charset"
"github.com/pingcap/tidb/parser/mysql"
Expand Down Expand Up @@ -811,7 +812,7 @@ func (cc *clientConn) preparedStmt2String(stmtID uint32) string {
return ""
}
if sv.EnableRedactLog {
return cc.preparedStmt2StringNoArgs(stmtID)
return parser.Normalize(cc.preparedStmt2StringNoArgs(stmtID))
}
return cc.preparedStmt2StringNoArgs(stmtID) + sv.PlanCacheParams.String()
}
Expand Down

0 comments on commit 72e079c

Please sign in to comment.