Opened 20 years ago
Last modified 16 years ago
#2170 closed defect
db lookup methods not case sensitive on mysql — at Version 3
| Reported by: | derelm | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
i noticed that the methods field__exact and field__iexact match case insensitive on mysql
given you have a field (choices=(('a','small a'),('A','capital a'))) field__exact will always match both choices.
possible solution:
in django.db.backends.mysql.base
OPERATOR_MAPPING = {
'exact': '= BINARY %s',
...
}
oh and will iexact, icontains, istatswith, iendswith all match exactly the same rows anyways?
Change History (4)
comment:1 by , 19 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
by , 19 years ago
| Attachment: | 2170-1.diff added |
|---|
comment:2 by , 19 years ago
| Has patch: | set |
|---|
Note:
See TracTickets
for help on using tickets.
This came up in IRC today, when somebody noted that it's resulting in an exception if you do FooModel.objects.get(charfield='foo') and have both 'foo' and 'Foo' in that field (Two rows returned instead of one as expected).