You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by el...@apache.org on 2024/10/17 16:00:46 UTC

(doris) branch master updated: [regression-test](suites) use master ip to do server side prepared (#41981)

This is an automated email from the ASF dual-hosted git repository.

eldenmoon 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 095651bb937 [regression-test](suites) use master ip to do server side prepared (#41981)
095651bb937 is described below

commit 095651bb937a5f8ecddd28d2bcddb58b642b9e19
Author: lihangyu <15...@163.com>
AuthorDate: Fri Oct 18 00:00:40 2024 +0800

    [regression-test](suites) use master ip to do server side prepared (#41981)
---
 .../main/java/org/apache/doris/qe/StmtExecutor.java  |  6 ++++--
 .../org/apache/doris/regression/suite/Suite.groovy   | 20 +++++++++++++++++++-
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
index 4a7b540d120..52245dfd765 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java
@@ -711,7 +711,8 @@ public class StmtExecutor {
                     if (logicalPlan instanceof InsertIntoTableCommand) {
                         profileType = ProfileType.LOAD;
                     }
-                    if (context.getCommand() == MysqlCommand.COM_STMT_PREPARE) {
+                    if (context.getCommand() == MysqlCommand.COM_STMT_PREPARE
+                            || context.getCommand() == MysqlCommand.COM_STMT_EXECUTE) {
                         throw new UserException("Forward master command is not supported for prepare statement");
                     }
                     if (isProxy) {
@@ -987,7 +988,8 @@ public class StmtExecutor {
                             profileType = ProfileType.LOAD;
                         }
                     }
-                    if (context.getCommand() == MysqlCommand.COM_STMT_PREPARE) {
+                    if (context.getCommand() == MysqlCommand.COM_STMT_PREPARE
+                                || context.getCommand() == MysqlCommand.COM_STMT_EXECUTE) {
                         throw new UserException("Forward master command is not supported for prepare statement");
                     }
                     if (isProxy) {
diff --git a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
index f54ec51b85e..c659affecbb 100644
--- a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
+++ b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
@@ -472,6 +472,24 @@ class Suite implements GroovyInterceptable {
         return res;
     }
 
+    String getMasterIp(Connection conn) {
+        def result = sql_return_maparray_impl("select Host, QueryPort, IsMaster from frontends();", conn)
+        logger.info("get master fe: ${result}")
+
+        def masterHost = ""
+        for (def row : result) {
+            if (row.IsMaster == "true") {
+                masterHost = row.Host
+                break
+            }
+        }
+
+        if (masterHost == "") {
+            throw new Exception("can not find master fe")
+        }
+        return masterHost;
+    }
+
     def jdbc_sql_return_maparray(String sqlStr) {
         return sql_return_maparray_impl(sqlStr, context.getConnection())
     }
@@ -1292,7 +1310,7 @@ class Suite implements GroovyInterceptable {
 
     String getServerPrepareJdbcUrl(String jdbcUrl, String database) {
         String urlWithoutSchema = jdbcUrl.substring(jdbcUrl.indexOf("://") + 3)
-        def sql_ip = urlWithoutSchema.substring(0, urlWithoutSchema.indexOf(":"))
+        def sql_ip = getMasterIp()
         def sql_port
         if (urlWithoutSchema.indexOf("/") >= 0) {
             // e.g: jdbc:mysql://locahost:8080/?a=b


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