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 0677b261b5 [fix](Nereids) should not process prepare command by 
Nereids (#22167)
0677b261b5 is described below

commit 0677b261b5730f4dcd2763e295762ee10e98ceec
Author: morrySnow <101034200+morrys...@users.noreply.github.com>
AuthorDate: Mon Jul 24 20:11:40 2023 +0800

    [fix](Nereids) should not process prepare command by Nereids (#22167)
---
 fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

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 0709064d01..f9c57f19ec 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
@@ -350,7 +350,7 @@ public class ConnectProcessor {
 
     // Process COM_QUERY statement,
     // only throw an exception when there is a problem interacting with the 
requesting client
-    private void handleQuery() {
+    private void handleQuery(MysqlCommand mysqlCommand) {
         MetricRepo.COUNTER_REQUEST_ALL.increase(1L);
         // convert statement to Java string
         byte[] bytes = packetBuf.array();
@@ -372,7 +372,8 @@ public class ConnectProcessor {
         Exception nereidsParseException = null;
         List<StatementBase> stmts = null;
 
-        if (ctx.getSessionVariable().isEnableNereidsPlanner()) {
+        // Nereids do not support prepare and execute now, so forbid prepare 
command, only process query command
+        if (mysqlCommand == MysqlCommand.COM_QUERY && 
ctx.getSessionVariable().isEnableNereidsPlanner()) {
             try {
                 stmts = new NereidsParser().parseSQL(originStmt);
                 for (StatementBase stmt : stmts) {
@@ -587,7 +588,7 @@ public class ConnectProcessor {
                 ctx.initTracer("trace");
                 Span rootSpan = 
ctx.getTracer().spanBuilder("handleQuery").setNoParent().startSpan();
                 try (Scope scope = rootSpan.makeCurrent()) {
-                    handleQuery();
+                    handleQuery(command);
                 } catch (Exception e) {
                     rootSpan.recordException(e);
                     throw e;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to