1
0
Fork 0

Merging upstream version 10.2.9.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 15:00:13 +01:00
parent 3439d8569e
commit 2468c1121f
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
13 changed files with 91 additions and 26 deletions

View file

@ -562,6 +562,7 @@ class Parser(metaclass=_Parser):
TRANSACTION_KIND = {"DEFERRED", "IMMEDIATE", "EXCLUSIVE"}
STRICT_CAST = True
LATERAL_FUNCTION_AS_VIEW = False
__slots__ = (
"error_level",
@ -1287,16 +1288,26 @@ class Parser(metaclass=_Parser):
return None
if not this:
this = self._parse_function()
table_alias = self._parse_id_var(any_token=False)
this = self._parse_function() or self._parse_id_var(any_token=False)
while self._match(TokenType.DOT):
this = exp.Dot(
this=this,
expression=self._parse_function() or self._parse_id_var(any_token=False),
)
columns = None
if self._match(TokenType.ALIAS):
columns = self._parse_csv(self._parse_id_var)
elif self._match(TokenType.L_PAREN):
columns = self._parse_csv(self._parse_id_var)
self._match_r_paren()
table_alias = None
if view or self.LATERAL_FUNCTION_AS_VIEW:
table_alias = self._parse_id_var(any_token=False)
if self._match(TokenType.ALIAS):
columns = self._parse_csv(self._parse_id_var)
else:
self._match(TokenType.ALIAS)
table_alias = self._parse_id_var(any_token=False)
if self._match(TokenType.L_PAREN):
columns = self._parse_csv(self._parse_id_var)
self._match_r_paren()
expression = self.expression(
exp.Lateral,