accept JSON_TABLE both as an unquoted table name and a table-valued function (#1134)

This commit is contained in:
Ophir LOJKINE 2024-02-15 12:34:38 +01:00 committed by GitHub
parent d59b6638fa
commit 1a07c5d67c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 1 deletions

View file

@ -7515,7 +7515,11 @@ impl<'a> Parser<'a> {
with_offset,
with_offset_alias,
})
} else if self.parse_keyword(Keyword::JSON_TABLE) {
} else if matches!(
self.peek_token().token, Token::Word(w)
if w.keyword == Keyword::JSON_TABLE && self.peek_nth_token(1).token == Token::LParen
) {
self.expect_keyword(Keyword::JSON_TABLE)?;
self.expect_token(&Token::LParen)?;
let json_expr = self.parse_expr()?;
self.expect_token(&Token::Comma)?;