Skip to content

Commit

Permalink
[4.2.x] Fixed #34978, Refs #31331 -- Added backward incompatibility n…
Browse files Browse the repository at this point in the history
…ote about raw aggregations on MySQL.

Thanks Matthew Somerville for the report.

Backport of a652f07 from main
  • Loading branch information
felixxm authored and nessita committed Nov 27, 2023
1 parent 450d518 commit cdb14cc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/releases/4.2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,16 @@ fields modified in the custom ``save()`` methods should be added to the
``update_fields`` keyword argument before calling ``super()``. See
:ref:`overriding-model-methods` for more details.

Dropped support for raw aggregations on MySQL
---------------------------------------------

MySQL 8+ allows functional dependencies on ``GROUP BY`` columns, so the
pre-Django 4.2 workaround of grouping by primary keys of the main table is
removed. As a consequence, using ``RawSQL()`` aggregations is no longer
supported on MySQL as there is no way to determine if such aggregations are
needed or valid in the ``GROUP BY`` clause. Use :ref:`aggregation-functions`
instead.

Miscellaneous
-------------

Expand Down

0 comments on commit cdb14cc

Please sign in to comment.