django1/django/db
Simon Charette c2d4926702 Fixed #31910 -- Fixed crash of GIS aggregations over subqueries.
Regression was introduced by fff5186 but was due a long standing issue.

AggregateQuery was abusing Query.subquery: bool by stashing its
compiled inner query's SQL for later use in its compiler which made
select_format checks for Query.subquery wrongly assume the provide
query was a subquery.

This patch prevents that from happening by using a dedicated
inner_query attribute which is compiled at a later time by
SQLAggregateCompiler.

Moving the inner query's compilation to SQLAggregateCompiler.compile
had the side effect of addressing a long standing issue with
aggregation subquery pushdown which prevented converters from being
run. This is now fixed as the aggregation_regress adjustments
demonstrate.

Refs #25367.

Thanks Eran Keydar for the report.
2020-11-04 09:54:58 +01:00
..
backends Refs #32061 -- Prevented password leak on MySQL dbshell crash. 2020-10-30 10:12:52 +01:00
migrations Fixed #31954 -- Fixed migration optimization for MTI model creation with parent model with mixed case app label. 2020-08-28 13:35:13 +02:00
models Fixed #31910 -- Fixed crash of GIS aggregations over subqueries. 2020-11-04 09:54:58 +01:00
__init__.py Removed an outdated comment on DefaultConnectionProxy. 2019-02-20 11:30:51 -05:00
transaction.py Fixed #30116 -- Dropped support for Python 3.5. 2019-01-30 10:19:48 -05:00
utils.py Fixed #25388 -- Added an option to allow disabling of migrations during test database creation. 2019-11-20 20:42:38 +01:00