1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #23259 -- Corrected insertion order of extra() select_params

A regression caused queries to produce incorrect results for cases where
extra(select) is excluded by values() but included by extra(order_by)

The regression was caused by 2f35c6f10f.
This commit is contained in:
Rajiv Makhijani
2014-08-08 03:08:26 -07:00
committed by Anssi Kääriäinen
parent 12ad61aa9f
commit f0b358880a
2 changed files with 22 additions and 1 deletions

View File

@@ -117,7 +117,7 @@ class SQLCompiler(object):
if self.query.distinct:
result.append(self.connection.ops.distinct_sql(distinct_fields))
params.extend(o_params)
result.append(', '.join(out_cols + self.ordering_aliases))
params.extend(s_params)
params.extend(self.ordering_params)
@@ -146,6 +146,7 @@ class SQLCompiler(object):
if ordering:
result.append('ORDER BY %s' % ', '.join(ordering))
params.extend(o_params)
if with_limits:
if self.query.high_mark is not None: