#33482: filter on exists-subquery with emoty queryset removes whole WHERE block
-------------------------------------+-------------------------------------
Reporter: Tobias Bengfort | Owner: nobody
Type: Uncategorized | Status: new
Component: Database layer | Version: 4.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: orm, | Triage Stage:
EmptyResultSet, Exists | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Tobias Bengfort:
Old description:
> >>> qs = MyModel.objects.filter(~models.Exists(MyModel.objects.none()),
> name='test')
> >>> qs
> <QuerySet []>
> >>> print(qs.query)
> EmptyResultSet
>
> With django-debug-toolbar I can still see the query, but there WHERE
> block is missing completely.
>
> This seems to be very similar to #33018.
New description:
{{{
>>> qs = MyModel.objects.filter(~models.Exists(MyModel.objects.none()),
name='test')
>>> qs
<QuerySet []>
>>> print(qs.query)
EmptyResultSet
}}}
With django-debug-toolbar I can still see the query, but there WHERE block
is missing completely.
This seems to be very similar to #33018.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/33482#comment:2>
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/060.cffed7f080ccd752d956679e7fc20620%40djangoproject.com.