[Fix](audit) do not use duplicate query id in fe.audit.log (#11746)
The original logic in ConnectProcessor.java might result in duplicate query id for different query statement in fe.audit.log as follows.
This commit is contained in:
@ -294,13 +294,13 @@ public class ConnectProcessor {
|
||||
auditInfoList.add(new Pair<>(executor.getParsedStmt(), executor.getQueryStatisticsForAuditLog()));
|
||||
}
|
||||
|
||||
// audit after exec
|
||||
// audit after exec, analysis query would not be recorded
|
||||
if (!auditInfoList.isEmpty()) {
|
||||
for (Pair<StatementBase, Data.PQueryStatistics> audit : auditInfoList) {
|
||||
auditAfterExec(originStmt.replace("\n", " "), audit.first, audit.second);
|
||||
}
|
||||
} else {
|
||||
// auditInfoList can be empty if we encounter analysis error.
|
||||
} else if (QueryState.ErrType.ANALYSIS_ERR != ctx.getState().getErrType()) {
|
||||
// auditInfoList can be empty if we encounter error.
|
||||
auditAfterExec(originStmt.replace("\n", " "), null, null);
|
||||
}
|
||||
if (executor != null) {
|
||||
|
||||
Reference in New Issue
Block a user