This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 726c857140c [fix](audit) fix sql has same sqlhash in one request
(#48242)
726c857140c is described below
commit 726c857140c94ae06e0760bc3eb74461c8b78fa9
Author: feiniaofeiafei <[email protected]>
AuthorDate: Tue Feb 25 09:53:04 2025 +0800
[fix](audit) fix sql has same sqlhash in one request (#48242)
### What problem does this PR solve?
Problem Summary:
before this pr:
send multi statements in one request: sq1(e.g. select 1 from
t1);sql2(e.g. select 2 from t2);sql3(e.g. use db1)
The sqlhash of sql1, sql2 and sql3 is same.
after this pr:
the sqlhash of sql1 and sql2 and sql3 is different.
---
fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java
b/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java
index fa39a7f6166..0e51b7d3049 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java
@@ -319,6 +319,9 @@ public abstract class ConnectProcessor {
boolean usingOrigSingleStmt = origSingleStmtList != null &&
origSingleStmtList.size() == stmts.size();
for (int i = 0; i < stmts.size(); ++i) {
String auditStmt = usingOrigSingleStmt ? origSingleStmtList.get(i)
: convertedStmt;
+ if (stmts.size() > 1 && usingOrigSingleStmt) {
+ ctx.setSqlHash(DigestUtils.md5Hex(auditStmt));
+ }
try {
ctx.getState().reset();
if (i > 0) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]