Skip to content

Commit 0b1e0c3

Browse files
authored
MSSQL: Add support for parenthesized stored procedure name in EXEC (#2126)
1 parent 048bc8f commit 0b1e0c3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/parser/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17368,7 +17368,11 @@ impl<'a> Parser<'a> {
1736817368
{
1736917369
None
1737017370
} else {
17371+
let has_parentheses = self.consume_token(&Token::LParen);
1737117372
let name = self.parse_object_name(false)?;
17373+
if has_parentheses {
17374+
self.expect_token(&Token::RParen)?;
17375+
}
1737217376
Some(name)
1737317377
};
1737417378

tests/sqlparser_common.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12120,6 +12120,8 @@ fn parse_execute_stored_procedure() {
1212012120
}
1212112121
_ => unreachable!(),
1212212122
}
12123+
// Test optional parentheses around procedure name
12124+
ms_and_generic().one_statement_parses_to("EXEC ('name')", "EXECUTE 'name'");
1212312125
}
1212412126

1212512127
#[test]

0 commit comments

Comments
 (0)