#9848: QuerySet.update() can cause data corruption if the QuerySet filters only 
on
fields in other tables
------------------------------------------+---------------------------------
 Reporter:  Jamie Gennis                  |       Owner:  nobody    
   Status:  new                           |   Milestone:            
Component:  Database layer (models, ORM)  |     Version:  1.0       
 Keywords:                                |       Stage:  Unreviewed
Has_patch:  1                             |  
------------------------------------------+---------------------------------
 Changeset [http://code.djangoproject.com/changeset/7496 7496] introduced
 an optimization for filtered updates that eliminates the table being
 updated from the sub-select used to do the filtering.  This optimization
 is used when the filter does not reference any fields in the update-table
 (i.e. the table being updated).  To do this the sub-select must select IDs
 from a column in one of the related tables rather than the update-table.
 However, the where clause of the update still filters based on the primary
 key of the update-table being in the result set of the sub-select.  This
 means that in some cases it will update the rows for which the update-
 table's primary key matches the primary key of one of the related tables,
 potentially causing data corruption.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9848>
Django <http://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 post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to