#33374: ExpressionWrapper for ~Q(pk__in=[]) crashes.
-------------------------------------+-------------------------------------
Reporter: Stefan Brand | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 3.1
(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
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):
* component: Uncategorized => Database layer (models, ORM)
* stage: Unreviewed => Accepted
Comment:
Good catch!
{{{#!python
>>> books =
Book.objects.annotate(selected=ExpressionWrapper(~Q(pk__in=[]),
output_field=BooleanField())).values('selected')
>>> list(books)
Traceback (most recent call last):
File "/django/django/db/backends/utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
File "/django/django/db/backends/sqlite3/base.py", line 420, in execute
return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: near "AS": syntax error
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33374#comment:3>
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/069.e93ee1d642e966b50e322929f087dee5%40djangoproject.com.