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 88e2753e404 [fix](Nereids) fix ShowProcedureStatusCommand 
sendResultSet (#35355)
88e2753e404 is described below

commit 88e2753e4043ecc25441235ed200e263f4912f82
Author: zy-kkk <[email protected]>
AuthorDate: Fri May 24 17:22:07 2024 +0800

    [fix](Nereids) fix ShowProcedureStatusCommand sendResultSet (#35355)
---
 fe/fe-core/src/main/java/org/apache/doris/analysis/ShowDbStmt.java  | 3 ++-
 .../nereids/trees/plans/commands/ShowCreateProcedureCommand.java    | 6 ++----
 .../nereids/trees/plans/commands/ShowProcedureStatusCommand.java    | 6 ++----
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowDbStmt.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowDbStmt.java
index f02ffd35be0..c9606bc5bd2 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowDbStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/ShowDbStmt.java
@@ -25,6 +25,7 @@ import org.apache.doris.common.UserException;
 import org.apache.doris.datasource.InternalCatalog;
 import org.apache.doris.qe.ShowResultSetMetaData;
 
+import com.google.common.base.Strings;
 import com.google.common.collect.Lists;
 
 // Show database statement.
@@ -95,7 +96,7 @@ public class ShowDbStmt extends ShowStmt {
         if (pattern != null) {
             sb.append(" LIKE '").append(pattern).append("'");
         }
-        if (!InternalCatalog.INTERNAL_CATALOG_NAME.equals(catalogName)) {
+        if (!Strings.isNullOrEmpty(catalogName) && 
!InternalCatalog.INTERNAL_CATALOG_NAME.equals(catalogName)) {
             sb.append(" FROM ").append(catalogName);
         }
         return sb.toString();
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowCreateProcedureCommand.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowCreateProcedureCommand.java
index 85c97a2ba15..1eac3cdc867 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowCreateProcedureCommand.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowCreateProcedureCommand.java
@@ -65,10 +65,8 @@ public class ShowCreateProcedureCommand extends Command 
implements NoForward {
     public void run(ConnectContext ctx, StmtExecutor executor) throws 
Exception {
         List<List<String>> results = new ArrayList<>();
         
ctx.getPlSqlOperation().getExec().functions.showCreateProcedure(this.procedureName,
 results);
-        if (!results.isEmpty()) {
-            ShowResultSet commonResultSet = new ShowResultSet(getMetaData(), 
results);
-            executor.sendResultSet(commonResultSet);
-        }
+        ShowResultSet commonResultSet = new ShowResultSet(getMetaData(), 
results);
+        executor.sendResultSet(commonResultSet);
     }
 
     @Override
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowProcedureStatusCommand.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowProcedureStatusCommand.java
index 4ba6688d4f4..e8be38f65ed 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowProcedureStatusCommand.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ShowProcedureStatusCommand.java
@@ -63,10 +63,8 @@ public class ShowProcedureStatusCommand extends Command 
implements NoForward {
     public void run(ConnectContext ctx, StmtExecutor executor) throws 
Exception {
         List<List<String>> results = new ArrayList<>();
         ctx.getPlSqlOperation().getExec().functions.showProcedure(results);
-        if (!results.isEmpty()) {
-            ShowResultSet commonResultSet = new ShowResultSet(getMetaData(), 
results);
-            executor.sendResultSet(commonResultSet);
-        }
+        ShowResultSet commonResultSet = new ShowResultSet(getMetaData(), 
results);
+        executor.sendResultSet(commonResultSet);
     }
 
     @Override


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

Reply via email to