#30120 closed Bug (fixed)
Query syntax error with condition and distinct combination
Reported by: | Claude Paroz | Owned by: | Simon Charette |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 2.2 |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
A Count
annotation containing both a Case
condition and a distinct=True
param produces a query error on Django 2.2 (whatever the db backend). A space is missing at least (... COUNT(DISTINCTCASE WHEN ...
).
Attachments (1)
Change History (7)
by , 6 years ago
Attachment: | query_test.diff added |
---|
comment:1 by , 6 years ago
Bisected to [bc05547cd8c1dd511c6b6a6c873a1bc63417b111] Fixed #28658 -- Added DISTINCT handling to the Aggregate class.
comment:2 by , 6 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 6 years ago
Has patch: | set |
---|
Note:
See TracTickets
for help on using tickets.
Failing test example