1
0
Fork 0

Merging upstream version 25.26.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 21:56:02 +01:00
parent 9138e4b92a
commit 829a709061
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
117 changed files with 49296 additions and 47316 deletions

View file

@ -562,8 +562,8 @@ def _traverse_scope(scope):
elif isinstance(expression, exp.DML):
yield from _traverse_ctes(scope)
for query in find_all_in_scope(expression, exp.Query):
# This check ensures we don't yield the CTE queries twice
if not isinstance(query.parent, exp.CTE):
# This check ensures we don't yield the CTE/nested queries twice
if not isinstance(query.parent, (exp.CTE, exp.Subquery)):
yield from _traverse_scope(Scope(query, cte_sources=scope.cte_sources))
return
else:
@ -679,6 +679,8 @@ def _traverse_tables(scope):
expressions.extend(scope.expression.args.get("laterals") or [])
for expression in expressions:
if isinstance(expression, exp.Final):
expression = expression.this
if isinstance(expression, exp.Table):
table_name = expression.name
source_name = expression.alias_or_name