1
0
mirror of https://github.com/django/django.git synced 2025-01-03 15:06:09 +00:00

Refs #35339 -- Fixed source expressions in GeoAggregate on Oracle.

Regression in 42b567ab4c.
This commit is contained in:
Mariusz Felisiak 2024-04-27 03:36:07 +02:00 committed by GitHub
parent 828b94b178
commit 8c257cecff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,17 +34,14 @@ class GeoAggregate(Aggregate):
tolerance = self.extra.get("tolerance") or getattr(self, "tolerance", 0.05)
clone = self.copy()
source_expressions = self.get_source_expressions()
if self.filter:
source_expressions.pop()
source_expressions.pop() # Don't wrap filters with SDOAGGRTYPE().
spatial_type_expr = Func(
*source_expressions,
Value(tolerance),
function="SDOAGGRTYPE",
output_field=self.output_field,
)
source_expressions = [spatial_type_expr]
if self.filter:
source_expressions.append(self.filter)
source_expressions = [spatial_type_expr, self.filter]
clone.set_source_expressions(source_expressions)
return clone.as_sql(compiler, connection, **extra_context)
return self.as_sql(compiler, connection, **extra_context)