Changes between Version 1 and Version 2 of Ticket #34978, comment 4


Ignore:
Timestamp:
Nov 20, 2023, 9:27:13 AM (13 months ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #34978, comment 4

    v1 v2  
    4343> This one's interesting because we can't dig into RawSQL to determine whether it's valid in a GROUP BY or not.
    4444
    45 That's right David, it's the crux of the issue. Since it's a blackbox the ORM must choose between grouping or not by the column and since most `RawSQL` usage are assumed to not be aggregation it determines that it must do so.
     45That's right David, it's the crux of the issue. The ORM must choose between grouping or not by the expression and since most `RawSQL` usage are assumed to not be aggregation it determines that it must do so as it's a blackbox from an introspection perspective.
    4646
    4747The reason why 041551d716b69ee7c81199eee86a2d10a72e15ab broke the reported use that is that prior to this change the ORM supported a non-standard feature of MySQL [https://dev.mysql.com/doc/refman/8.0/en/sql-mode.html disabled in recent versions] that allowed grouping solely by the primary key of the first entry in `FROM`. It's important to note that using `RawSQL` to aggregate was only working on MySQL due to this feature and never worked on any of the other backends that follow the functional dependency detection in `GROUP BY` clauses as specified by the `SQL:1999` standard.
Back to Top