diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-11-21 16:36:50 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-11-21 16:48:05 -0500 |
| commit | 7998f15b1687a0bd0b322d2a3afc8450d7a32503 (patch) | |
| tree | c82eca73d5b71c95efce9ce6301a14de76387e84 /lib/sqlalchemy | |
| parent | 3eac2d89c2b7e60eeadb13571216d9c5f619e9af (diff) | |
| download | sqlalchemy-7998f15b1687a0bd0b322d2a3afc8450d7a32503.tar.gz | |
- Fixed joinedload bug which would occur when a. the query includes
limit/offset criteria that forces a subquery b. the relationship
uses "secondary" c. the primaryjoin of the relationship refers to
a column that is either not part of the primary key, or is a PK
col in a joined-inheritance subclass table that is under a different
attribute name than the parent table's primary key column d. the
query defers the columns that are present in the primaryjoin, typically
via not being included in load_only(); the necessary column(s) would
not be present in the subquery and produce invalid SQL.
fixes #3592
(cherry picked from commit 60c36ca8418cec180733a4d97637699fa2d3c36e)
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/orm/strategies.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/strategies.py b/lib/sqlalchemy/orm/strategies.py index 67dac1ccc..7de470dd5 100644 --- a/lib/sqlalchemy/orm/strategies.py +++ b/lib/sqlalchemy/orm/strategies.py @@ -1367,8 +1367,7 @@ class JoinedLoader(AbstractRelationshipLoader): # send a hint to the Query as to where it may "splice" this join eagerjoin.stop_on = entity.selectable - if self.parent_property.secondary is None and \ - not parentmapper: + if not parentmapper: # for parentclause that is the non-eager end of the join, # ensure all the parent cols in the primaryjoin are actually # in the |
