Incorrect SQL for aliased_entity.to_many_property.of_type(...).any()
Issue #1325
resolved
The following query
# Engineer is derived from Employee
c = aliased(Company)
print list(session.query(c).filter(c.employees.of_type(Engineer).any()))
generates SQL, which refers to table {{{companies}}}, which is not present in the FROM clause. Should refer to the aliased table.
The following query works well.
print list(session.query(c).filter(c.employees.any()))
Full test case is attached.
Comments (2)
-
repo owner -
repo owner - removed milestone
Removing milestone: 0.5.xx (automated comment)
- Log in to comment
excellent test case, thanks for your contribution. this is fixed in 8d295ec1189576f4ab918f8288812277567db6a1.