1
0
mirror of https://github.com/django/django.git synced 2025-03-10 01:12:53 +00:00
Simon Charette cf95de9d24 [4.2.x] Fixed #34987 -- Fixed queryset crash when mixing aggregate and window annotations.
Regression in f387d024fc75569d2a4a338bfda76cc2f328f627.

Just like `OrderByList` the `ExpressionList` expression used to wrap
`Window.partition_by` must implement `get_group_by_cols` to ensure the
necessary grouping when mixing window expressions with aggregate
annotations is performed against the partition members and not the
partition expression itself.

This is necessary because while `partition_by` is implemented as
a source expression of `Window` it's actually a fragment of the WINDOW
expression at the SQL level and thus it should result in a group by its
members and not the sum of them.

Thanks ElRoberto538 for the report.
Backport of e76cc93b0168fa3abbafb9af1ab4535814b751f0 from main
2023-11-23 06:10:24 +01:00
..
2019-11-26 14:02:24 +01:00
2023-04-17 07:44:29 +02:00
2023-04-17 07:44:29 +02:00
2023-04-17 07:44:29 +02:00
2023-04-17 07:44:29 +02:00
2023-04-17 07:44:29 +02:00
2016-05-02 18:16:36 -04:00
2016-06-04 19:24:51 -04:00
2016-09-01 16:24:46 -04:00
2017-01-04 13:20:01 -05:00
2017-06-01 11:09:51 -04:00
2017-07-01 19:13:35 -04:00
2017-08-01 08:08:18 -04:00
2017-10-05 14:13:32 -04:00
2017-11-01 21:11:38 -04:00
2018-07-02 10:12:20 +02:00
2018-10-01 09:34:57 +02:00
2018-12-03 15:14:58 +01:00
2023-04-17 07:44:29 +02:00
2018-06-28 11:07:37 -04:00
2018-08-31 10:12:51 +02:00
2018-12-03 17:29:46 +01:00
2019-07-01 07:48:45 +02:00
2022-02-02 07:17:57 +01:00
2023-04-17 07:44:29 +02:00
2020-01-02 07:55:53 +01:00
2020-02-03 08:52:16 +01:00
2023-04-17 07:44:29 +02:00
2020-10-01 07:22:28 +02:00
2020-12-01 06:24:16 +01:00
2021-01-04 08:31:51 +01:00
2021-09-01 07:40:01 +02:00
2021-10-05 09:07:26 +02:00
2021-11-01 10:18:49 +01:00
2022-02-02 07:17:57 +01:00
2023-04-17 07:44:29 +02:00
2022-02-02 07:17:57 +01:00
2023-04-17 07:44:29 +02:00
2022-09-05 05:21:23 +02:00
2022-11-01 06:54:19 +01:00
2022-12-06 09:56:43 +01:00
2023-01-02 08:10:59 +01:00