From bdbe164d392d41991b64ced0f097930a04a2c420 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 17 Jan 2020 14:31:10 -0500 Subject: apply asbool reduction to the onclause in join() The :func:`.true` and :func:`.false` operators may now be applied as the "onclause" of a :func:`.sql.join` on a backend that does not support "native boolean" expressions, e.g. Oracle or SQL Server, and the expression will render as "1=1" for true and "1=0" false. This is the behavior that was introduced many years ago in :ticket:`2804` for and/or expressions. Change-Id: I85311c31c22d6e226c618f8840f6b95eca611153 --- lib/sqlalchemy/sql/selectable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql/selectable.py') diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index 136c9f868..db743f408 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -698,7 +698,7 @@ class Join(FromClause): if onclause is None: self.onclause = self._match_primaries(self.left, self.right) else: - self.onclause = onclause + self.onclause = onclause.self_group(against=operators._asbool) self.isouter = isouter self.full = full -- cgit v1.2.1