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

github-bot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new 0b1e0c35 MSSQL: Add support for parenthesized stored procedure name in 
EXEC (#2126)
0b1e0c35 is described below

commit 0b1e0c35d956edd51bfa00c3a18c5c44ccd8343f
Author: Yoav Cohen <[email protected]>
AuthorDate: Wed Dec 10 06:53:22 2025 -0500

    MSSQL: Add support for parenthesized stored procedure name in EXEC (#2126)
---
 src/parser/mod.rs         | 4 ++++
 tests/sqlparser_common.rs | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/src/parser/mod.rs b/src/parser/mod.rs
index c499829c..dc529945 100644
--- a/src/parser/mod.rs
+++ b/src/parser/mod.rs
@@ -17368,7 +17368,11 @@ impl<'a> Parser<'a> {
         {
             None
         } else {
+            let has_parentheses = self.consume_token(&Token::LParen);
             let name = self.parse_object_name(false)?;
+            if has_parentheses {
+                self.expect_token(&Token::RParen)?;
+            }
             Some(name)
         };
 
diff --git a/tests/sqlparser_common.rs b/tests/sqlparser_common.rs
index cfee2621..da8e7b49 100644
--- a/tests/sqlparser_common.rs
+++ b/tests/sqlparser_common.rs
@@ -12120,6 +12120,8 @@ fn parse_execute_stored_procedure() {
         }
         _ => unreachable!(),
     }
+    // Test optional parentheses around procedure name
+    ms_and_generic().one_statement_parses_to("EXEC ('name')", "EXECUTE 
'name'");
 }
 
 #[test]


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

Reply via email to