#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: ontowhee
Type: Bug | Status: assigned
Component: Database layer | Version: 4.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: mysql | Triage Stage: Accepted
only_full_group_by |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):
* needs_better_patch: 0 => 1
Comment:
> With CASE, it does return NULL values. I don't know if that is an issue,
because ANY_VALUE can return NULL for MySQL.
I think that's fine given an explicit `COALESCE` could be used if needs
be. I suspect `AnyValue` will end up mostly being useful to assist MySQL
functional dependency resolver and rarely with `filter` anyway.
Left some comments about the mention of support for SQLite in the release
notes as well as supported Tim's request for slight tweaks of docs in
MySQL specific parts. It also seems like `ANY_VALUE` can be used on MySQL
even when `ONLY_FULL_GROUP_BY` is disabled.
--
Ticket URL: <https://code.djangoproject.com/ticket/34262#comment:20>
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/01070195ab243b75-82a5446f-f374-4d79-a247-a5129d2ed951-000000%40eu-central-1.amazonses.com.