Merging upstream version 16.2.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
c12f551e31
commit
718a80b164
106 changed files with 41940 additions and 40162 deletions
|
@ -145,7 +145,7 @@ def _mergeable(outer_scope, inner_scope, leave_tables_isolated, from_or_join):
|
|||
if not isinstance(from_or_join, exp.Join):
|
||||
return False
|
||||
|
||||
alias = from_or_join.this.alias_or_name
|
||||
alias = from_or_join.alias_or_name
|
||||
|
||||
on = from_or_join.args.get("on")
|
||||
if not on:
|
||||
|
@ -253,10 +253,6 @@ def _merge_joins(outer_scope, inner_scope, from_or_join):
|
|||
"""
|
||||
|
||||
new_joins = []
|
||||
comma_joins = inner_scope.expression.args.get("from").expressions[1:]
|
||||
for subquery in comma_joins:
|
||||
new_joins.append(exp.Join(this=subquery, kind="CROSS"))
|
||||
outer_scope.add_source(subquery.alias_or_name, inner_scope.sources[subquery.alias_or_name])
|
||||
|
||||
joins = inner_scope.expression.args.get("joins") or []
|
||||
for join in joins:
|
||||
|
@ -328,13 +324,12 @@ def _merge_where(outer_scope, inner_scope, from_or_join):
|
|||
if source == from_or_join.alias_or_name:
|
||||
break
|
||||
|
||||
if set(exp.column_table_names(where.this)) <= sources:
|
||||
if exp.column_table_names(where.this) <= sources:
|
||||
from_or_join.on(where.this, copy=False)
|
||||
from_or_join.set("on", from_or_join.args.get("on"))
|
||||
return
|
||||
|
||||
expression.where(where.this, copy=False)
|
||||
expression.set("where", expression.args.get("where"))
|
||||
|
||||
|
||||
def _merge_order(outer_scope, inner_scope):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue