Ticket #14357: unordering.patch

File unordering.patch, 813 bytes (added by Martin Chase, 14 years ago)
  • db/models/sql/compiler.py

    diff --git a/db/models/sql/compiler.py b/db/models/sql/compiler.py
    index eaf2cd2..be1b9d8 100644
    a b class SQLCompiler(object):  
    9090                if not self.connection.features.allows_group_by_pk:
    9191                    for col, col_params in ordering_group_by:
    9292                        if col not in grouping:
    93                             grouping.append(str(col))
    94                             gb_params.extend(col_params)
     93                            for order in ordering:
     94                                if col in order:
     95                                    ordering.remove(order)
    9596            else:
    9697                ordering = self.connection.ops.force_no_ordering()
    9798            result.append('GROUP BY %s' % ', '.join(grouping))
Back to Top