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:
committed by
Tim Graham
parent
74ddd0e83b
commit
dfcdc8992f
@@ -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({}) || '%%'",
|
||||
|
||||
Reference in New Issue
Block a user