summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-11-21 16:36:50 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2015-11-21 16:36:50 -0500
commit60c36ca8418cec180733a4d97637699fa2d3c36e (patch)
treeb8d5c95b22bfb041ce6ac43f57cd1d21993946bd /lib/sqlalchemy/orm
parent068d37035a5d0004dc93712f4fa88703aefa4076 (diff)
downloadsqlalchemy-60c36ca8418cec180733a4d97637699fa2d3c36e.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
Diffstat (limited to 'lib/sqlalchemy/orm')
-rw-r--r--lib/sqlalchemy/orm/strategies.py3
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