#35665: Prefetch() fails with "OrderByList" when queryset has no order_by and is
sliced
-------------------------------------+-------------------------------------
     Reporter:  Andrew               |                    Owner:  Simon
                                     |  Charette
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  5.1
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:  fixed
     Keywords:  prefetch slice       |             Triage Stage:  Ready for
  order_by                           |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

 In [changeset:"df236b0bcbbf1f54dfe6acc7761cd81b76ebf2cc" df236b0]:
 {{{#!CommitTicketReference repository=""
 revision="df236b0bcbbf1f54dfe6acc7761cd81b76ebf2cc"
 [5.1.x] Fixed #35665 -- Fixed a crash when passing an empty order_by to
 Window.

 This also caused un-ordered sliced prefetches to crash as they rely on
 Window.

 Regression in e16d0c176e9b89628cdec5e58c418378c4a2436a that made
 OrderByList
 piggy-back ExpressionList without porting the empty handling that the
 latter
 provided.

 Supporting explicit empty ordering on Window functions and slicing is
 arguably
 a foot-gun design due to how backends will return undeterministic results
 but
 this is a problem that requires a larger discussion.

 Refs #35064.

 Thanks Andrew Backer for the report and Mariusz for the review.

 Backport of 602fe961e6834d665f2359087a1272e9f9806b71 from main.
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35665#comment:6>
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/010701914b115330-9bfb5b61-07ce-4d3a-9315-85614d908ecd-000000%40eu-central-1.amazonses.com.

Reply via email to