- changed status to resolved
Query.union producing query with polymorphic discriminator when not appropriate
Issue #3856
resolved
a.union(b) is unnecessarily including polymorphic discriminator when a and b contain columns from a polymorphic subclass, whereas union(a, b) does not. The result is cartesian product from a.union(b). A demo file is attached.
Comments (3)
-
repo owner -
repo owner thanks for the report
-
reporter Thanks for the quick fix!
- Log in to comment
Disable single-inheritance critera on the outside of UNION
Fixed bug related to
3177
, where a UNION or other set operation emitted by a :class:.Query
would apply "single-inheritance" criteria to the outside of the union (also referencing the wrong selectable), even though this criteria is now expected to be already present on the inside subqueries. The single-inheritance criteria is now omitted once union() or another set operation is called against :class:.Query
in the same way as :meth:.Query.from_self
.Change-Id: I0fd1331c7ba85a758a1c15e06c271914f2c717f3 Fixes:
#3856→ <<cset 7de0d1785335>>