joined eager load innerjoin=True not accommodated by with_polymorphic / joined inh
Please see the test case, the error is pretty clear I think :)
Comments (6)
-
reporter -
repo owner so this is because of your innerjoin=True on that relationship. this is a difficult issue to fix and I don't have any solution for it at the moment. you'd need to be explicit about your innerjoin and either turn it off w/ the with_polymorphic or leave it off by default for now.
-
repo owner - changed title to joined eager load innerjoin=True not accommodated by with_polymorphic / joined inh
- changed milestone to 1.3
this is a tricky one and will take some time / thought.
-
repo owner - changed milestone to 1.2
https://gerrit.sqlalchemy.org/402
this is for 1.2 at the moment, I'm a little nervous about a 1.1 for this because it will change queries from INNER JOIN to OUTER JOIN, if some app is silently relying on this and is not hitting the bug (because they really are loading only one kind of entity) it could cause a sudden performance issue.
-
reporter thank you very much for the quick fix :-) much appreciated!
-
repo owner - changed status to resolved
Demote innerjoin to outerjoin coming from with_polymorphic
a with_polymorphic, regardless of inheritance type, represents multiple classes. A subclass that wants to joinedload with innerjoin=True needs to be demoted to an outerjoin because the parent entity rows might not be of that type. Looks more intuitive with a joined inheritance load, but applies just as well to single or concrete.
Change-Id: I4d3d76106ae20032269f8848aad70a8e2f9422f9 Fixes:
#3988→ <<cset 94a089bc2b42>>
- Log in to comment
the problem is that SQLAlchemy generates:
instead of something like: