#34267: QuerySet.union() crashes with IndexError when getting cached results.
-------------------------------------+-------------------------------------
     Reporter:  Raphaƫl Stefanini    |                    Owner:  Francesco
                                     |  Panico
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  4.2
  (models, ORM)                      |
     Severity:  Release blocker      |               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 Simon Charette):

 It seems that the issue is likely due the
 
[https://github.com/django/django/commit/3d734c09ff0138441dfe0a59010435871d17950f
 #diff-
 f58de2deaccecd2d53199c5ca29e3e1050ec2adb80fb057cdfc0b4e6accdf14fR547-R551
 if sliced] branch which was hoping to port the optimization that made
 `union().exists()` have all the involved subqueries augmented with `LIMIT
 1` if supported by the backend.

 I believe that this optimization can likely be removed since backends are
 likely smart enough to perform this optimization themselves when `EXISTS`
 is used.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34267#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/01070185c24b5b39-36c5ecf6-7cc2-4f9e-b2ff-7856f2c861b6-000000%40eu-central-1.amazonses.com.

Reply via email to