MSSQL: Add support for parenthesized store procedure name in EXEC

This commit is contained in:
Yoav Cohen 2025-12-07 16:26:20 -05:00
parent ca2d333dff
commit 78a2e2651a
2 changed files with 6 additions and 0 deletions

View file

@ -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)
};

View file

@ -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]