Query fails if distinct is specified and oder.by has more than one column

Issue #273 resolved
Former user created an issue

A select query fails if the parameter 'distinct' is specified and 'order_by' is also specified and has more than one column, because a lack of iteration over the append_column() call.

Attached is a one-line patch which fixes the problem:

Index: query.py

--- query.py (revisi¢n: 1790) +++ query.py (copia de trabajo) @@ -364,7 +364,7 @@ # to use it in "order_by". insure they are in the column criterion (particularly oid). # TODO: this should be done at the SQL level not the mapper level if kwargs.get('distinct', False) and order_by: - statement.append_column(*util.to_list(order_by)) + for c in util.to_list(order_by) # plugin point

     # give all the attached properties a chance to modify the query

Regards,

Raul Garcia.

Comments (1)

  1. Log in to comment