Skip to content

Commit

Permalink
session: add current DB to CRUCIAL OPERATION log (pingcap#8447)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackysp authored and zz-jason committed Nov 26, 2018
1 parent 8be09da commit cb64314
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,8 @@ func logStmt(node ast.StmtNode, vars *variable.SessionVars) {
if ss, ok := node.(ast.SensitiveStmtNode); ok {
log.Infof("[CRUCIAL OPERATION] con:%d schema_ver:%d %s (by %s).", vars.ConnectionID, schemaVersion, ss.SecureText(), user)
} else {
log.Infof("[CRUCIAL OPERATION] con:%d schema_ver:%d %s (by %s).", vars.ConnectionID, schemaVersion, stmt.Text(), user)
log.Infof("[CRUCIAL OPERATION] con:%d schema_ver:%d cur_db:%s %s (by %s).", vars.ConnectionID,
schemaVersion, vars.CurrentDB, stmt.Text(), user)
}
default:
logQuery(node.Text(), vars)
Expand Down

0 comments on commit cb64314

Please sign in to comment.