Ticket #9682: django-force-collation-for-ci.diff
File django-force-collation-for-ci.diff, 1.1 KB (added by , 16 years ago) |
---|
-
db/backends/mysql/base.py
199 199 second = '%s-12-31 23:59:59.99' 200 200 return [first % value, second % value] 201 201 202 _icollate = hasattr(settings, "MYSQL_FORCE_COLLATION_FOR_CI") and ("COLLATE %s " % settings.MYSQL_FORCE_COLLATION_FOR_CI) or "" 203 202 204 class DatabaseWrapper(BaseDatabaseWrapper): 203 205 204 206 operators = { 205 207 'exact': '= %s', 206 'iexact': 'LIKE %s',208 'iexact': _icollate + 'LIKE %s', 207 209 'contains': 'LIKE BINARY %s', 208 'icontains': 'LIKE %s',210 'icontains': _icollate + 'LIKE %s', 209 211 'regex': 'REGEXP BINARY %s', 210 'iregex': 'REGEXP %s',212 'iregex': _icollate + 'REGEXP %s', 211 213 'gt': '> %s', 212 214 'gte': '>= %s', 213 215 'lt': '< %s', 214 216 'lte': '<= %s', 215 217 'startswith': 'LIKE BINARY %s', 216 218 'endswith': 'LIKE BINARY %s', 217 'istartswith': 'LIKE %s',218 'iendswith': 'LIKE %s',219 'istartswith': _icollate + 'LIKE %s', 220 'iendswith': _icollate + 'LIKE %s', 219 221 } 220 222 221 223 def __init__(self, **kwargs):