add current DB name to general log (#9332)
This commit is contained in:
@ -1641,7 +1641,8 @@ func logStmt(node ast.StmtNode, vars *variable.SessionVars) {
|
||||
func logQuery(query string, vars *variable.SessionVars) {
|
||||
if atomic.LoadUint32(&variable.ProcessGeneralLog) != 0 && !vars.InRestrictedSQL {
|
||||
query = executor.QueryReplacer.Replace(query)
|
||||
log.Infof("[GENERAL_LOG] con:%d user:%s schema_ver:%d txn_start_ts:%d sql:%s%s",
|
||||
vars.ConnectionID, vars.User, vars.TxnCtx.SchemaVersion, vars.TxnCtx.StartTS, query, vars.GetExecuteArgumentsInfo())
|
||||
log.Infof("[GENERAL_LOG] con:%d user:%s schema_ver:%d txn_start_ts:%d current_db:%s, sql:%s%s",
|
||||
vars.ConnectionID, vars.User, vars.TxnCtx.SchemaVersion, vars.TxnCtx.StartTS, vars.CurrentDB, query,
|
||||
vars.GetExecuteArgumentsInfo())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user