#28731: Passing an empty Q() to a When inside a Case causes an OperationError
-------------------------------------+-------------------------------------
Reporter: Tom van Bussel | Owner: Tim
| Martin
Type: Bug | Status: assigned
Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Tim Martin):
Worse, you get the same result for `Q() & Q(value=1)` as you do for `Q() |
Q(value=1)`, because empty `Q()` expressions are ignored when combining
(`query_utils.py:68`). I don't think there's an easy way to make this
consistent.
I'm guessing it should be possible to make the originally reported case
not trigger invalid SQL, which is a step forward. Maybe it should report
this as an invalid expression?
--
Ticket URL: <https://code.djangoproject.com/ticket/28731#comment:9>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.d7f486f085438d83f18ca2275d2a7384%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.