diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-10-08 16:42:21 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-10-09 11:05:58 -0400 |
| commit | 105810c92123c74b0066ef01db5d1696932800c6 (patch) | |
| tree | eb445a962c83cfbfb30026d246398064ba8f9eaf /lib/sqlalchemy/sql/selectable.py | |
| parent | cab08ea1834ac519f124789b835afa6832972b1c (diff) | |
| download | sqlalchemy-105810c92123c74b0066ef01db5d1696932800c6.tar.gz | |
Omit onclause as source of FROMs from a Join
The :class:`.Join` construct no longer considers the "onclause" as a source
of additional FROM objects to be omitted from the FROM list of an enclosing
:class:`.Select` object as standalone FROM objects. This applies to an ON
clause that includes a reference to another FROM object outside the JOIN;
while this is usually not correct from a SQL perspective, it's also
incorrect for it to be omitted, and the behavioral change makes the
:class:`.Select` / :class:`.Join` behave a bit more intuitively.
Fixes: #4621
Change-Id: Iaa1e75b7c59b21e9701ab3c9b69e66930feaf8ee
Diffstat (limited to 'lib/sqlalchemy/sql/selectable.py')
| -rw-r--r-- | lib/sqlalchemy/sql/selectable.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index 6282cf2ee..6a7413fc0 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -1157,12 +1157,7 @@ class Join(FromClause): @property def _from_objects(self): - return ( - [self] - + self.onclause._from_objects - + self.left._from_objects - + self.right._from_objects - ) + return [self] + self.left._from_objects + self.right._from_objects # FromClause -> |
