diff options
| author | Luke Plant <L.Plant.98@cantab.net> | 2011-05-07 19:02:51 +0000 |
|---|---|---|
| committer | Luke Plant <L.Plant.98@cantab.net> | 2011-05-07 19:02:51 +0000 |
| commit | 385ae343fbd2355a09ba0f459445bf04406db60b (patch) | |
| tree | 4a64edfe731519e07218693a70a0a746f47e86b6 /django | |
| parent | 32bd953e632ffaf6c1d4f8514600986e729ecb66 (diff) | |
Fixed #15709 - Duplicated group_by condition
Thanks to ziangsong for report, and to mk for the patch
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16180 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/sql/compiler.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index ace9cf4c88..841ec12f2d 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -493,7 +493,11 @@ class SQLCompiler(object): params.extend(extra_params) cols = (group_by + self.query.select + self.query.related_select_cols + extra_selects) + seen = set() for col in cols: + if col in seen: + continue + seen.add(col) if isinstance(col, (list, tuple)): result.append('%s.%s' % (qn(col[0]), qn(col[1]))) elif hasattr(col, 'as_sql'): |
