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

morrysnow pushed a commit to branch pick_3.1_58287
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 00a9b3a6f433a32b22d360bdecd8fe5e9eac759d
Author: morrySnow <[email protected]>
AuthorDate: Tue Nov 25 10:31:40 2025 +0800

    branch-3.1: [fix](variable) support set ON and ALL to variable #58287
    
    picked from #58287
---
 fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4  | 5 +++--
 .../java/org/apache/doris/nereids/parser/NereidsParserTest.java     | 6 ++++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4 
b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
index 12d41dd3c0f..783b0f5f6d8 100644
--- a/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
+++ b/fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4
@@ -891,7 +891,7 @@ unsupportedSetStatement
     ;
 
 optionWithType
-    : (GLOBAL | LOCAL | SESSION) identifier EQ (expression | DEFAULT)
+    : (GLOBAL | LOCAL | SESSION) identifier EQ (expression | DEFAULT | ON | 
ALL)
     ;
 
 optionWithoutType
@@ -907,7 +907,8 @@ optionWithoutType
     ;
 
 variable
-    : (DOUBLEATSIGN ((GLOBAL | LOCAL | SESSION) DOT)?)? identifier EQ 
(expression | DEFAULT) #setSystemVariable
+    : (DOUBLEATSIGN ((GLOBAL | LOCAL | SESSION) DOT)?)? identifier EQ
+        (expression | DEFAULT | ON | ALL) #setSystemVariable
     | ATSIGN identifier EQ expression #setUserVariable
     ;
 
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/nereids/parser/NereidsParserTest.java
 
b/fe/fe-core/src/test/java/org/apache/doris/nereids/parser/NereidsParserTest.java
index 18bce009623..8080390c5db 100644
--- 
a/fe/fe-core/src/test/java/org/apache/doris/nereids/parser/NereidsParserTest.java
+++ 
b/fe/fe-core/src/test/java/org/apache/doris/nereids/parser/NereidsParserTest.java
@@ -508,6 +508,12 @@ public class NereidsParserTest extends ParserTestBase {
         sql = "set session a = default";
         nereidsParser.parseSingle(sql);
 
+        sql = "set a = on";
+        nereidsParser.parseSingle(sql);
+
+        sql = "set a = all";
+        nereidsParser.parseSingle(sql);
+
         sql = "set @@a = 10";
         nereidsParser.parseSingle(sql);
 


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

Reply via email to