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 28787 MySQL Update fails Paulo nobody "Given the models below: {{{ class House(models.Model): name = models.CharField(max_length=200) class Room(models.Model): name = models.CharField(max_length=200) house = models.ForeignKey(House, on_delete=models.CASCADE) }}} The following query fails: {{{ houses_with_suites = House.objects.filter(room__name__icontains='suite') Room.objects.filter(house__in=houses_with_suites).update(name='suite') }}} With this error: {{{ OperationalError: (1093, ""You can't specify target table 'mysql_test_room' for update in FROM clause"") }}} I think this has been around for a while (https://code.djangoproject.com/ticket/20300). I've confirmed this only happens in MySQL. It works on PostgresSQL and SQLite." Uncategorized new Uncategorized 1.11 Normal Unreviewed 0 0 0 0 0 0