Skip to content

Commit 323b27c

Browse files
yoavcloudayman-sigma
authored andcommitted
MSSQL: Add support for parenthesized stored procedure name in EXEC (apache#2126)
1 parent 7b9d444 commit 323b27c

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
@@ -17400,7 +17400,11 @@ impl<'a> Parser<'a> {
1740017400
{
1740117401
None
1740217402
} else {
17403+
let has_parentheses = self.consume_token(&Token::LParen);
1740317404
let name = self.parse_object_name(false)?;
17405+
if has_parentheses {
17406+
self.expect_token(&Token::RParen)?;
17407+
}
1740417408
Some(name)
1740517409
};
1740617410

tests/sqlparser_common.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12123,6 +12123,8 @@ fn parse_execute_stored_procedure() {
1212312123
}
1212412124
_ => unreachable!(),
1212512125
}
12126+
// Test optional parentheses around procedure name
12127+
ms_and_generic().one_statement_parses_to("EXEC ('name')", "EXECUTE 'name'");
1212612128
}
1212712129

1212812130
#[test]

0 commit comments

Comments
 (0)