summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/util.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-05-02 11:33:54 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-05-02 11:33:54 -0400
commit8ac2bec0292daaefdfd4062a209ae4c44ba6d690 (patch)
treec10d7051b47464f0ba97d78d7e5ec6b0e5465fa9 /lib/sqlalchemy/orm/util.py
parent77db0ef6ac03d0f6f5622be373f7f85536924d3e (diff)
downloadsqlalchemy-8ac2bec0292daaefdfd4062a209ae4c44ba6d690.tar.gz
- Liberalized an assertion that was added as part of :ticket:`3347`
to protect against unknown conditions when splicing inner joins together within joined eager loads with ``innerjoin=True``; if some of the joins use a "secondary" table, the assertion needs to unwrap further joins in order to pass. fixes #3412
Diffstat (limited to 'lib/sqlalchemy/orm/util.py')
-rw-r--r--lib/sqlalchemy/orm/util.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py
index b9098c77c..823b97239 100644
--- a/lib/sqlalchemy/orm/util.py
+++ b/lib/sqlalchemy/orm/util.py
@@ -849,7 +849,11 @@ class _ORMJoin(expression.Join):
Given join(a, b) and join(b, c), return join(a, b).join(c)
"""
- assert self.right is other.left
+ leftmost = other
+ while isinstance(leftmost, sql.Join):
+ leftmost = leftmost.left
+
+ assert self.right is leftmost
left = _ORMJoin(
self.left, other.left,