#34358: qs.filter(Exact(expr, value)) doesn’t work
-------------------------------------+-------------------------------------
Reporter: Roman Odaisky | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 4.1
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):
* status: new => closed
* resolution: => fixed
Comment:
The issue appears to be fixed in Django 4.2 by
59bea9efd2768102fc9d3aedda469502c218e9b7 (#28477) which strips unused
annotation.
{{{#!sql
SELECT COUNT(*)
FROM (
SELECT "parent"."id"
FROM "parent"
LEFT OUTER JOIN "child" ON ("parent"."id" = "child"."parent_id")
GROUP BY 0
HAVING COUNT("child"."id") = 0
) subquery
}}}
Prior to this change the generate SQL was simply wrong as `HAVING` cannot
be used without a `GROUP BY`
Please test against 4.2b1 and confirm if your issue is fixed or not.
--
Ticket URL: <https://code.djangoproject.com/ticket/34358#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070186723c62bd-98fc2ad1-505a-48e2-a9fd-4ff196f54550-000000%40eu-central-1.amazonses.com.