#19263: DatabaseError on using empty Page .object_list in __in clause in a query
------------------------------+------------------------------------
     Reporter:  chkwok@…      |                    Owner:  biern
         Type:  Bug           |                   Status:  assigned
    Component:  Core (Other)  |                  Version:  1.4
     Severity:  Normal        |               Resolution:
     Keywords:                |             Triage Stage:  Accepted
    Has patch:  1             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+------------------------------------
Changes (by biern):

 * has_patch:  0 => 1


Comment:

 This was a bug related to improper behaviour of querysets sliced with
 equal indices, which generated empty sql that caused errors when used in
 subqueries.

 This query failed:
 Book.objects.filter(author__in=Author.objects.empty()[0:0])
 while this succeded:
 Book.objects.filter(author__in=Author.objects.empty())

 Instead of later returning empty sql string, a QuerySet with equal indices
 is now immediately converted to QuerySet.none().

 https://github.com/django/django/pull/808

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19263#comment:4>
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].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to