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:45:23 -0300
commitcbd1e913ef9fd9ef3a59a8607b2c9ccc34a64db3 (patch)
tree9edd86f7b5cfc7dc31ad25e762838151cb621bf2
parentd9ba8fa3972dd78c38cc94c08ad6514e8a2e237d (diff)
[5.0.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
-------------