mirror of
https://github.com/django/django.git
synced 2025-12-07 18:26:41 +00:00
Refs #10113 -- Modified the generated SQL to remove redundant GROUP BY elements, and modified the test added in [9788] to remove a test result that depended on a potentially ambiguous database ordering.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9791 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
ff78aef93b
commit
08dd4176ed
2 changed files with 4 additions and 3 deletions
|
|
@ -385,7 +385,8 @@ class BaseQuery(object):
|
|||
# other than MySQL), then any fields mentioned in the
|
||||
# ordering clause needs to be in the group by clause.
|
||||
if not self.connection.features.allows_group_by_pk:
|
||||
grouping.extend(ordering_group_by)
|
||||
grouping.extend([col for col in ordering_group_by
|
||||
if col not in grouping])
|
||||
else:
|
||||
ordering = self.connection.ops.force_no_ordering()
|
||||
result.append('GROUP BY %s' % ', '.join(grouping))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue