﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
9848	QuerySet.update() can cause data corruption if the QuerySet filters only on fields in other tables	Jamie Gennis	Jamie Gennis	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.		closed	Database layer (models, ORM)	1.0		fixed			Accepted	1	0	0	0	0	0
