1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #29886 -- Fixed unaccent lookup when PostgreSQL's standard_conforming_strings option is off.

Thanks Tom McClure for the patch.
This commit is contained in:
Jayantha Gumballi
2018-11-01 20:44:34 +05:30
committed by Tim Graham
parent 74ddd0e83b
commit dfcdc8992f
2 changed files with 20 additions and 1 deletions

View File

@@ -121,7 +121,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
#
# Note: we use str.format() here for readability as '%' is used as a wildcard for
# the LIKE operator.
pattern_esc = r"REPLACE(REPLACE(REPLACE({}, '\', '\\'), '%%', '\%%'), '_', '\_')"
pattern_esc = r"REPLACE(REPLACE(REPLACE({}, E'\\', E'\\\\'), E'%%', E'\\%%'), E'_', E'\\_')"
pattern_ops = {
'contains': "LIKE '%%' || {} || '%%'",
'icontains': "LIKE '%%' || UPPER({}) || '%%'",