DISTINCT is used in select() but not in count() in SelectResults
Issue #287
resolved
When you use distinct=True in a select() statement on a table which has activated the SeelctResults extension, a SELECT DISTINCT statemet is generated. But if you use the same clause and distinct=True in a count() statement, the distinct=True parameter is ignored and the count is wrong.
Using SelectResults you cannto do a .select(...).count(). The same occurs when you use a session.query(Obj).select(), if you substitute the .select() for .count() wrong results are returned, and as the session.query(Obj).select() result is a list of objects, you cannot do a .select().count()
Attached is a small test progam which exercises the bug in the SeelctResults case.
Raul Garcia.
Comments (1)
-
repo owner - Log in to comment
fix applied in changeset:1828