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

xuyang 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 169c805bed6 [bug](restore) Fix npe of cancel restore command (#54520)
169c805bed6 is described below

commit 169c805bed61dca81154c9d73431820494de4a47
Author: xy720 <[email protected]>
AuthorDate: Mon Aug 11 23:37:35 2025 +0800

    [bug](restore) Fix npe of cancel restore command (#54520)
    
    Fix:
    
    ```
    mysql> cancel restore;
    ERROR 1105 (HY000): errCode = 2, detailMessage = Cannot invoke 
"org.apache.doris.nereids.DorisParser$IdentifierContext.getText()" because 
"ctx.database" is null
    
    mysql> cancel backup;
    ERROR 1105 (HY000): errCode = 2, detailMessage = Cannot invoke 
"org.apache.doris.nereids.DorisParser$IdentifierContext.getText()" because 
"ctx.database" is null
    ```
---
 .../main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
index 3bcb36debde..e5eecb1ea4c 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java
@@ -8332,14 +8332,14 @@ public class LogicalPlanBuilder extends 
DorisParserBaseVisitor<Object> {
 
     @Override
     public LogicalPlan visitCancelBackup(DorisParser.CancelBackupContext ctx) {
-        String databaseName = ctx.database.getText();
+        String databaseName = ctx.database != null ? ctx.database.getText() : 
null;
         boolean isRestore = false;
         return new CancelBackupCommand(databaseName, isRestore);
     }
 
     @Override
     public LogicalPlan visitCancelRestore(DorisParser.CancelRestoreContext 
ctx) {
-        String databaseName = ctx.database.getText();
+        String databaseName = ctx.database != null ? ctx.database.getText() : 
null;
         boolean isRestore = true;
         return new CancelBackupCommand(databaseName, isRestore);
     }


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

Reply via email to