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

morningman pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new eb5773059fe [fix](repository) fix NullPointerException when execute 
create repository statement without properties (#30972) (#31069)
eb5773059fe is described below

commit eb5773059fe92954f22a25cff5aeb4e4324ff373
Author: caiconghui <[email protected]>
AuthorDate: Sun Feb 18 20:27:49 2024 +0800

    [fix](repository) fix NullPointerException when execute create repository 
statement without properties (#30972) (#31069)
    
    bp #30972
    Co-authored-by: caiconghui1 <[email protected]>
---
 fe/fe-core/src/main/cup/sql_parser.cup                                | 4 ++--
 .../src/main/java/org/apache/doris/analysis/RefreshCatalogStmt.java   | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/fe/fe-core/src/main/cup/sql_parser.cup 
b/fe/fe-core/src/main/cup/sql_parser.cup
index 3f279c2d2dd..7920c962efb 100644
--- a/fe/fe-core/src/main/cup/sql_parser.cup
+++ b/fe/fe-core/src/main/cup/sql_parser.cup
@@ -3486,7 +3486,7 @@ key_value_map ::=
 
 opt_properties ::=
     {:
-    RESULT = null;
+    RESULT = Maps.newHashMap();
     :}
     | properties:properties
     {:
@@ -3496,7 +3496,7 @@ opt_properties ::=
 
 opt_ext_properties ::=
     {:
-    RESULT = null;
+    RESULT = Maps.newHashMap();
     :}
     | KW_BROKER properties:properties
     {:
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/RefreshCatalogStmt.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/RefreshCatalogStmt.java
index 006eebe44b3..a2e5930d142 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/RefreshCatalogStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/RefreshCatalogStmt.java
@@ -73,7 +73,8 @@ public class RefreshCatalogStmt extends DdlStmt {
         }
 
         // Set to false only if user set the property "invalid_cache"="false"
-        invalidCache = !(properties != null && 
properties.get(INVALID_CACHE).equalsIgnoreCase("false"));
+        invalidCache = !(properties.get(INVALID_CACHE) != null && 
properties.get(INVALID_CACHE)
+                .equalsIgnoreCase("false"));
     }
 
     @Override


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

Reply via email to