#34978: Annotating through an aggregate with RawSQL() raises 1056 "Can't group 
on"
on MySQL/MariaDB.
-------------------------------------+-------------------------------------
     Reporter:  Matthew Somerville   |                    Owner:  Simon
                                     |  Charette
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  4.2
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Natalia Bidart):

 Replying to [comment:4 Simon Charette]:
 > I could see us go three ways about dealing with this issue
 >
 > 1. Revert the changes made in 041551d716b69ee7c81199eee86a2d10a72e15ab
 while making `allows_group_by_pk` based on the absence of
 `ONLY_FULL_GROUP_BY`. Note that this won't resolve the aggregation over
 the annotation of a dependant subquery but will restore the usage of
 `RawSQL` for aggregation on MySQL only when `ONLY_FULL_GROUP_BY` is
 disabled.
 > 2. 1 + adjustments to the `allows_group_by_pk` to special case dependant
 subquery annotations
 > 3. Adjust the 4.2 existing release notes about this change to better
 communicate that this version of Django removed support for doing `RawSQL`
 aggregations on MySQL and that they should use proper expressions instead
 going forward.

 Given your rationale and considering that there are multiple workarounds
 as you proposed, I'm also in favor of option 3.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34978#comment:5>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018bedd0ef2c-9d64ddf7-94a9-40df-9c60-09faf916dbb3-000000%40eu-central-1.amazonses.com.

Reply via email to