#34262: Queryset grouped by annotation with aggregates on another annotated
expression crashes on MySQL with sql_mode=only_full_group_by.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: (none)
Type: Bug | Status: new
Component: Database layer | Version: 4.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: mysql | Triage Stage: Accepted
only_full_group_by |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):
There's none but you can
[https://docs.djangoproject.com/en/5.1/ref/models/expressions/#creating-
your-own-aggregate-functions easily write your own] and circumvent the
problems MySQL exhibits
{{{#!python
from django.db.models.aggregate import Aggregate
class AnyValue(Aggregate):
function = "ANY_VALUE"
}}}
Given MySQL, Postgres 16+, and Oracle 19c+ [https://modern-
sql.com/caniuse/any_value support it] it might be worth considering adding
it to core and documenting that it must be used under some circumstances
on MySQL?
--
Ticket URL: <https://code.djangoproject.com/ticket/34262#comment:13>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070194df5c37af-fd495185-edf6-4535-b35d-ac4351411e6f-000000%40eu-central-1.amazonses.com.