I have a django 1.2.1 instance running on ubuntu with mysql 5 backend. I am trying to make a case-sensitive query that should return only one result, but I get two results back that have the same content but with different cases.
I want to get an entry with the following heading: Cat Syndrome
So, I am using the following query:
c = Change.objects.filter(change_type='new',title__exact='Cat on the Internet syndrome')
and I get the following results:
>>> c [<Change: Change object>, <Change: Change object>]
The headers of each change object:
>>> for i in c: ... print i.title ... Cat on the Internet Syndrome Cat on the Internet syndrome
As you can see, the โSโ in the syndrome inside each object name has a different case of the Syndrome S. It seemed to me that I read the documentation [0] that all queries were specified by the โexactโ type by default. I get the same results when I don't specify title__exact='Cat on the Internet syndrome' .
How do I ensure that case sensitivity is used in the query I set out above?
[0] http://docs.djangoproject.com/en/dev/ref/models/querysets/#std:fieldlookup-exact
Edit: Mysql version:
mysql Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (i486) using readline 6.1
source share