1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #31965 -- Adjusted multi-table fast-deletion on MySQL/MariaDB.

The optimization introduced in 7acef095d7 did not properly handle
deletion involving filters against aggregate annotations.

It initially was surfaced by a MariaDB test failure but misattributed
to an undocumented change in behavior that resulted in the systemic
generation of poorly performing database queries in 5b83bae031.

Thanks Anton Plotkin for the report.

Refs #23576.
This commit is contained in:
Simon Charette
2020-08-30 03:00:15 -04:00
committed by Mariusz Felisiak
parent 38fce49c82
commit f6405c0b8e
5 changed files with 35 additions and 11 deletions

View File

@@ -141,7 +141,7 @@ class Base(models.Model):
class RelToBase(models.Model):
base = models.ForeignKey(Base, models.DO_NOTHING)
base = models.ForeignKey(Base, models.DO_NOTHING, related_name='rels')
class Origin(models.Model):