1
0
mirror of https://github.com/django/django.git synced 2025-01-18 06:12:23 +00:00

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

Regression in 42b567ab4c5bfb1bbd3e629b1079271c5ae44ea0.
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) tolerance = self.extra.get("tolerance") or getattr(self, "tolerance", 0.05)
clone = self.copy() clone = self.copy()
source_expressions = self.get_source_expressions() source_expressions = self.get_source_expressions()
if self.filter: source_expressions.pop() # Don't wrap filters with SDOAGGRTYPE().
source_expressions.pop()
spatial_type_expr = Func( spatial_type_expr = Func(
*source_expressions, *source_expressions,
Value(tolerance), Value(tolerance),
function="SDOAGGRTYPE", function="SDOAGGRTYPE",
output_field=self.output_field, output_field=self.output_field,
) )
source_expressions = [spatial_type_expr] source_expressions = [spatial_type_expr, self.filter]
if self.filter:
source_expressions.append(self.filter)
clone.set_source_expressions(source_expressions) clone.set_source_expressions(source_expressions)
return clone.as_sql(compiler, connection, **extra_context) return clone.as_sql(compiler, connection, **extra_context)
return self.as_sql(compiler, connection, **extra_context) return self.as_sql(compiler, connection, **extra_context)