#34459: SearchVector() can return query strings that are unsafe to combine.
----------------------------------+------------------------------------
Reporter: Patryk Zawadzki | Owner: (none)
Type: Bug | Status: new
Component: contrib.postgres | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------
Comment (by Phil Gyford):
This is probably the same issue, but wanted to check it wasn't only
tangentially related and so missed.
If I have a model with a field like:
{{{
search_document = SearchVectorField(null=True)
}}}
Then I try to update that for object 123 by doing:
{{{
MyModel.objects.filter(pk=123).update(search_document=SearchVector(Value('10%')))
}}}
then with psycopg2 I get "IndexError: tuple index out of range".
and with psycopg3 I get "ProgrammingError: only '%s', '%b', '%t' are
allowed as placeholders, got '%''"
If I omit the % then there's no error.
--
Ticket URL: <https://code.djangoproject.com/ticket/34459#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018751c65212-18bbb0e1-59a3-4570-8da8-834e88f723c5-000000%40eu-central-1.amazonses.com.