Since `DISTINCT` is repeatedly used by subclasses and likely to be useful
for custom `Aggregate` subclasses (PostgreSQL supports `DISTINCT` on all
aggregate functions, SQLite on all aggregates with a single argument, ...)
I suggest we handle it in the `Aggregate` base class.
We should be able to rely on `DatebaseOperations.check_expression_support`
to prevent `distinct=True` from being passed to aggregates not supporting
it on a backend basis.
--
Ticket URL: <https://code.djangoproject.com/ticket/28658>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/9174 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/28658#comment:1>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/28658#comment:2>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/28658#comment:3>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/28658#comment:4>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/28658#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"bc05547cd8c1dd511c6b6a6c873a1bc63417b111" bc05547]:
{{{
#!CommitTicketReference repository=""
revision="bc05547cd8c1dd511c6b6a6c873a1bc63417b111"
Fixed #28658 -- Added DISTINCT handling to the Aggregate class.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28658#comment:6>
Comment (by Claude Paroz):
Regression reported in #30120
--
Ticket URL: <https://code.djangoproject.com/ticket/28658#comment:7>
Comment (by Tim Graham <timograham@…>):
In [changeset:"6516e49262546238d02f6ca37b74ee0e67dead0a" 6516e492]:
{{{
#!CommitTicketReference repository=""
revision="6516e49262546238d02f6ca37b74ee0e67dead0a"
[2.2.x] Fixed #30120 -- Fixed invalid SQL in distinct aggregate.
Regression in bc05547cd8c1dd511c6b6a6c873a1bc63417b111 (refs #28658).
Backport of 65858119d23e37872505a4476e7141c33981fb50 from master.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28658#comment:8>
Comment (by Tim Graham <timograham@…>):
In [changeset:"65858119d23e37872505a4476e7141c33981fb50" 65858119]:
{{{
#!CommitTicketReference repository=""
revision="65858119d23e37872505a4476e7141c33981fb50"
Fixed #30120 -- Fixed invalid SQL in distinct aggregate.
Regression in bc05547cd8c1dd511c6b6a6c873a1bc63417b111 (refs #28658).
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28658#comment:9>