#8877: Very strange bug in MySQL backend for exact query.
-------------------------------------+--------------------------------------
Reporter: bear330 | Owner: nobody
Status: new | Milestone:
Component: Core framework | Version: 1.0
Keywords: get exact SQL ORM MySQL | Stage: Unreviewed
Has_patch: 0 |
-------------------------------------+--------------------------------------
I have a User object whose username is 'jumann'.
When I do this:
{{{
>>> User.objects.get(username__exact='Jumann')
}}}
I got a user object <User: jumann>. This is bug?
The SQL generated is:
{{{
>>> connection.queries[-1]['sql']
u'SELECT `auth_user`.`id`, `auth_user`.`username`,
`auth_user`.`first_name`, `auth_user`.`last_name`, `auth_user`.`email`,
`auth_user`.`password`, `auth_user`.`is_staff`, `auth_user`.`is_active`,
`auth_user`.`is_superuser`, `auth_user`.`last_login`,
`auth_user`.`date_joined` FROM `auth_user` WHERE `auth_user`.`username` =
Jumann '
}}}
This is a invalid SQL statement, because the string Jumann is not quoted.
But I don't know why it will pass and give me a wrong result.
This problem is very serious...
--
Ticket URL: <http://code.djangoproject.com/ticket/8877>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---