summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-11-27 11:49:24 +0100
committerNatalia <124304+nessita@users.noreply.github.com>2023-11-27 12:44:18 -0300
commitcdb14cc18bbfc7c32a6139137fe0151875e1c92e (patch)
tree97491f6f234de7394b5a36e3139612ed32e95f05
parent450d518d2fe28b33a12805fcaaad53f8244bd5df (diff)
[4.2.x] Fixed #34978, Refs #31331 -- Added backward incompatibility note about raw aggregations on MySQL.
Thanks Matthew Somerville for the report. Backport of a652f0759651dd7103ed04336ef85dc410f680c1 from main
-rw-r--r--docs/releases/4.2.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/releases/4.2.txt b/docs/releases/4.2.txt
index 59f144a15c..4bc68bb8a4 100644
--- a/docs/releases/4.2.txt
+++ b/docs/releases/4.2.txt
@@ -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
-------------