#34254: Exists annotations can return non-boolean results (i.e. None) if used
with
an empty QuerySet.
-------------------------------------+-------------------------------------
Reporter: Keryn Knight | Owner:
| rajdesai24
Type: Bug | Status: assigned
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: Exists | Triage Stage: Accepted
EmptyQuerySet sqlite postgres |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):
Thanks for confirming Keryn, the difference in query generation is
effectively expected on depending on whether the backend has a native
boolean type.
-----
rajdesai24, sure thing please go ahead and submit a PR. Make sure to
include a regression test demonstrating the problem that fails without the
patch applied and passes with it applied.
I suggested adding one in `tests/annotations/tests.py` similarly to
[https://github.com/django/django/commit/dd1fa3a31b4680c0d3712e6ae122b878138580c7
#diff-
1dc2d9f6410d5dbede47f9ea73f97bb4942f00ffddffccf0857919835149cbd8R213-R218
the one] added in dd1fa3a31b4680c0d3712e6ae122b878138580c7 but using
`Exists` instead of `Subquery`.
--
Ticket URL: <https://code.djangoproject.com/ticket/34254#comment:5>
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/01070185be232abc-de29e836-7005-476d-9707-5b5c92801d35-000000%40eu-central-1.amazonses.com.