github-actions[bot] commented on code in PR #62651:
URL: https://github.com/apache/doris/pull/62651#discussion_r3114903666


##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -613,6 +615,11 @@ public void execute(TUniqueId queryId) throws Exception {
 
         try {
             try {
+                // Resolve workload group name early so it is available for 
audit logging even
+                // if the query fails before reaching Coordinator.exec() (e.g. 
during planning).
+                // Coordinator.exec() will overwrite this with the 
authoritative value later.
+                resolveWorkloadGroupName();

Review Comment:
   This only covers failures after `StmtExecutor.execute()` has already 
started. `ConnectProcessor.executeQuery()` still parses SQL before it 
constructs a `StmtExecutor`, and parse failures go straight to 
`handleQueryException()` -> `AuditLogHelper.logAuditLog()` 
(`ConnectProcessor.java` around the `parseWithFallback()` / 
`handleQueryException()` path). That means `SELEC 1` on a fresh connection 
still logs an empty `workload_group`, and the same syntax error on a reused 
connection still reuses the previous query's value because nothing cleared 
`ctx.workloadGroupName` before parse. Since the bug is connection-scoped stale 
state, the reset/resolve needs to happen before parse/audit in 
`ConnectProcessor` too, not only here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to