﻿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
31573	Support order_by().update() on MySQL/MariaDB.	Gerben Morsink	David Chorpash	"When a UniqueConstraint is used on an IntegerField and we want to update multiple rows of that field at once, we need to make sure we select the right order before the update, since MySQL does not support a deferred update (see: https://dev.mysql.com/doc/refman/5.7/en/update.html).

I expected simply doing:

qs.order_by('-integerfield').update(integerfield=F('integerfield')+1) would work, but it seems the Django ORM strips the order_by from the query before execution, it gives a django.db.utils.IntegrityError: (1062, ""Duplicate entry '' for key 'integerfield'"")."	New feature	closed	Database layer (models, ORM)	dev	Normal	fixed	update mysql order order_by	Adam Johnson	Ready for checkin	1	0	0	0	0	0
