New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #34459 -- Fixed SearchVector() crash for parameters with % characters. #16731
Conversation
47ba207
to
69c6695
Compare
# 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, [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was only necessary for a single test postgres_tests.test_search.SearchVectorIndexTests.test_search_vector_index
, however test_search_vector_index
didn't cover the way how Django handles creating new constraints. It was a temporary and bit clunky way to create a regression test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah in the end you found a nice result 👍
Thanks Patryk Zawadzki for the report. Regression in 09ffc5c.
@patrys Does it work for you? |
@felixxm while I did not test this PR specifically, I have an identical fix in my project branch, where I copied the entire |
Thanks 👍 |
# 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, [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah in the end you found a nice result 👍
Thanks y'all for reviews 👍 |
Thanks Patryk Zawadzki for the report.
Regression in 09ffc5c.
TO DO:
test for creating and index with(already tested inSearchVector
postgres_tests.test_search.SearchVectorIndexTests.test_search_vector_index
)addEDIT: unnecessary as composed options are passed in params)adapt_value()
topsycopg_any
and use it inSearchHeadline.as_sql()