Skip to content

Commit 9cf6f4e

Browse files
committed
fix: don't allow any_token on reserved keywords
1 parent 970c9c2 commit 9cf6f4e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sqlglot/parser.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ class Parser(metaclass=_Parser):
289289
RESERVED_TOKENS = {
290290
*Tokenizer.SINGLE_TOKENS.values(),
291291
TokenType.SELECT,
292-
}
292+
} - {TokenType.IDENTIFIER}
293293

294294
DB_CREATABLES = {
295295
TokenType.DATABASE,
@@ -4388,7 +4388,10 @@ def _parse_function_call(
43884388

43894389
return None
43904390

4391-
if not any_token and token_type not in self.FUNC_TOKENS:
4391+
if any_token:
4392+
if token_type in self.RESERVED_TOKENS:
4393+
return None
4394+
elif token_type not in self.FUNC_TOKENS:
43924395
return None
43934396

43944397
self._advance(2)

0 commit comments

Comments
 (0)