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:
committed by
Anssi Kääriäinen
parent
12ad61aa9f
commit
f0b358880a
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user