MSSQL: Add support for parenthesized stored procedure name in EXEC (#2126)

This commit is contained in:
Yoav Cohen 2025-12-10 06:53:22 -05:00 committed by GitHub
parent 048bc8f09d
commit 0b1e0c35d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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]