1
0
Fork 0

Merging upstream version 25.24.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 21:55:19 +01:00
parent a52cca819a
commit a43c78d8b5
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
75 changed files with 43236 additions and 41203 deletions

View file

@ -1070,7 +1070,11 @@ def sort_comparison(expression: exp.Expression) -> exp.Expression:
l_const = _is_constant(l)
r_const = _is_constant(r)
if (l_column and not r_column) or (r_const and not l_const):
if (
(l_column and not r_column)
or (r_const and not l_const)
or isinstance(r, exp.SubqueryPredicate)
):
return expression
if (r_column and not l_column) or (l_const and not r_const) or (gen(l) > gen(r)):
return INVERSE_COMPARISONS.get(expression.__class__, expression.__class__)(