Skip to content

Commit 531d0cf

Browse files
yoavcloudfmguerreiro
authored andcommitted
MSSQL: Add support for parenthesized stored procedure name in EXEC (apache#2126)
1 parent 43a4649 commit 531d0cf

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/parser/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17471,7 +17471,11 @@ impl<'a> Parser<'a> {
1747117471
{
1747217472
None
1747317473
} else {
17474+
let has_parentheses = self.consume_token(&Token::LParen);
1747417475
let name = self.parse_object_name(false)?;
17476+
if has_parentheses {
17477+
self.expect_token(&Token::RParen)?;
17478+
}
1747517479
Some(name)
1747617480
};
1747717481

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)