1
0
mirror of https://github.com/django/django.git synced 2025-10-25 14:46:09 +00:00

Fixed #34459 -- Fixed SearchVector() crash for parameters with % symbol.

Thanks Patryk Zawadzki for the report.

Regression in 09ffc5c121.
This commit is contained in:
Mariusz Felisiak
2023-04-05 19:34:16 +02:00
parent 02a04ab79a
commit 4bf4222010
3 changed files with 11 additions and 4 deletions

View File

@@ -144,10 +144,7 @@ class SearchVector(SearchVectorCombinable, Func):
weight_sql, extra_params = compiler.compile(clone.weight)
sql = "setweight({}, {})".format(sql, weight_sql)
# These parameters must be bound on the client side because we may
# want to create an index on this expression.
sql = connection.ops.compose_sql(sql, config_params + params + extra_params)
return sql, []
return sql, config_params + params + extra_params
class CombinedSearchVector(SearchVectorCombinable, CombinedExpression):