[CP] not to print plain text of query sql which contains sensitive data

This commit is contained in:
yinyj17
2023-10-09 12:17:17 +00:00
committed by ob-robot
parent a81e6710b5
commit 86005edbcc
11 changed files with 96 additions and 51 deletions

View File

@ -754,7 +754,8 @@ OB_INLINE int ObMPQuery::do_process(ObSQLSessionInfo &session,
K(ret), K(cli_ret), K(retry_ctrl_.need_retry()), K(sql));
} else {
LOG_WARN("run stmt_query failed, check if need retry",
K(ret), K(cli_ret), K(retry_ctrl_.need_retry()), K(sql));
K(ret), K(cli_ret), K(retry_ctrl_.need_retry()),
"sql", ctx_.is_sensitive_ ? ObString(OB_MASKED_STR) : sql);
}
ret = cli_ret;
if (OB_ERR_PROXY_REROUTE == ret) {
@ -876,7 +877,9 @@ OB_INLINE int ObMPQuery::do_process(ObSQLSessionInfo &session,
if (OB_ERR_PROXY_REROUTE == ret) {
LOG_DEBUG("query should be rerouted", K(ret), K(async_resp_used));
} else {
LOG_WARN("query failed", K(ret), K(session), K(sql), K(retry_ctrl_.need_retry()));
LOG_WARN("query failed", K(ret), K(session),
"sql", ctx_.is_sensitive_ ? ObString(OB_MASKED_STR) : sql,
K(retry_ctrl_.need_retry()));
}
// 当need_retry=false时,可能给客户端回过包了,可能还没有回过任何包。
// 不过,可以确定:这个请求出错了,还没处理完。如果不是已经交给异步EndTrans收尾,