#28787: QuerySet.update() fails on MySQL if a subquery references the base table
-------------------------------------+-------------------------------------
     Reporter:  Paulo                |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  1.11
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  invalid
     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 Sonu kumar):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 This doesn't look to be a bug in Django. This is a more of MySQL query
 parser bug.

 Query generated by Django ORM


 {{{
 UPDATE `CoreApp_room` SET `name` = 'suite'
 WHERE `CoreApp_room`.`house_id` IN
 ( SELECT U0.`id` FROM `CoreApp_house` U0
    INNER JOIN `CoreApp_room` U1
   ON (U0.`id` = U1.`house_id`)
   WHERE U1.`name` LIKE '%suite%'
 )
 }}}

 As we can the query generated by Django is totally valid but MySQL server
 has raise error

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28787#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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.10bbb4119bfdbf02c0b61ff1f3498b09%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to