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:
parent
828b94b178
commit
8c257cecff
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user