Skip to content

Commit a652f07

Browse files
committed
Fixed #34978, Refs #31331 -- Added backward incompatibility note about raw aggregations on MySQL.
Thanks Matthew Somerville for the report.
1 parent 9baaf89 commit a652f07

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/releases/4.2.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,16 @@ fields modified in the custom ``save()`` methods should be added to the
409409
``update_fields`` keyword argument before calling ``super()``. See
410410
:ref:`overriding-model-methods` for more details.
411411

412+
Dropped support for raw aggregations on MySQL
413+
---------------------------------------------
414+
415+
MySQL 8+ allows functional dependencies on ``GROUP BY`` columns, so the
416+
pre-Django 4.2 workaround of grouping by primary keys of the main table is
417+
removed. As a consequence, using ``RawSQL()`` aggregations is no longer
418+
supported on MySQL as there is no way to determine if such aggregations are
419+
needed or valid in the ``GROUP BY`` clause. Use :ref:`aggregation-functions`
420+
instead.
421+
412422
Miscellaneous
413423
-------------
414424

0 commit comments

Comments
 (0)