You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2023/04/30 11:44:21 UTC

[doris] 10/15: [Fix](Planner) fix throw NPE when parse error (#19097)

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

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

commit 90efc2e031589bd8942ec3bbd5d2587dd28f3d28
Author: mch_ucchi <41...@users.noreply.github.com>
AuthorDate: Wed Apr 26 19:19:55 2023 +0800

    [Fix](Planner) fix throw NPE when parse error (#19097)
    
    some syntax error will cause unclear msg: NPE,because symbol.value is null and cause NPE when call toLowerCase(), we fix it by check if the value is null and return early.
---
 fe/fe-core/src/main/jflex/sql_scanner.flex | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fe/fe-core/src/main/jflex/sql_scanner.flex b/fe/fe-core/src/main/jflex/sql_scanner.flex
index 25a6a60a6b..597c23eec1 100644
--- a/fe/fe-core/src/main/jflex/sql_scanner.flex
+++ b/fe/fe-core/src/main/jflex/sql_scanner.flex
@@ -525,6 +525,9 @@ import org.apache.doris.qe.SqlModeHelper;
   }
 
   public static boolean isKeyword(String str) {
+        if (str == null) {
+            return false;
+        }
 	    return keywordMap.containsKey(str.toLowerCase());
   }
 


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