#18743: select_for_update() silently ignored on aggregate queries
-------------------------------------+-------------------------------------
     Reporter:  anonymous            |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  1.4
  (models, ORM)                      |               Resolution:  wontfix
     Severity:  Normal               |             Triage Stage:
     Keywords:                       |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Josh Kupershmidt <schmiddy@…>):

 I agree with the OP, as I was pretty surprised by Django's behavior here
 myself recently when attempting to use select_for_update() in combination
 with a Sum() aggregate. I would have liked to see an explicit error in
 this case. And I think this kind of confusion may be common, see e.g.

 http://stackoverflow.com/questions/18455473/why-cant-i-use-select-for-
 update-with-aggregate-functions

 I think if we can raise an Exception for unsupported operations such as
 in, say:

   Passing nowait=True to select_for_update() using database backends that
 do not support nowait, such as MySQL, will cause a DatabaseError to be
 raised.

 Then there is a good case to be made for raising an Exception here.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18743#comment:2>
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/067.dcf04bd404159132d481133b77250d72%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to