This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new c3fad29a4fb [fix](webui) add connection context to avoid NPE (#49213)
(#49353)
c3fad29a4fb is described below
commit c3fad29a4fb06ef77503dca077609b5b13430bf9
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Sat Mar 22 08:00:49 2025 +0800
[fix](webui) add connection context to avoid NPE (#49213) (#49353)
bp #49213
---
.../main/java/org/apache/doris/httpv2/util/StatementSubmitter.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/httpv2/util/StatementSubmitter.java
b/fe/fe-core/src/main/java/org/apache/doris/httpv2/util/StatementSubmitter.java
index 76f6a63b71a..884f7988aea 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/httpv2/util/StatementSubmitter.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/httpv2/util/StatementSubmitter.java
@@ -31,7 +31,9 @@ import org.apache.doris.common.ThreadPoolManager;
import org.apache.doris.common.util.SqlParserUtils;
import org.apache.doris.httpv2.util.streamresponse.JsonStreamResponse;
import org.apache.doris.httpv2.util.streamresponse.StreamResponseInf;
+import org.apache.doris.qe.AutoCloseConnectContext;
import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.statistics.util.StatisticsUtil;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@@ -221,7 +223,7 @@ public class StatementSubmitter {
private StatementBase analyzeStmt(String stmtStr) throws Exception {
SqlParser parser = new SqlParser(new SqlScanner(new
StringReader(stmtStr)));
- try {
+ try (AutoCloseConnectContext a =
StatisticsUtil.buildConnectContext(false)) {
return SqlParserUtils.getFirstStmt(parser);
} catch (AnalysisException e) {
String errorMessage = parser.getErrorMsg(stmtStr);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]