In various versions of Django, up to 1.11.5, with sqlite, on Windows:
{{{
class M(models.Model):
field = models.CharField(max_length=10)
}}}
{{{
>>> from bug import models
>>> print models.M.objects.filter(field='I am a string, look at
me').query.__str__()
SELECT "bug_m"."id", "bug_m"."field" FROM "bug_m" WHERE "bug_m"."field" =
I am a string, look at me
>>> models.M.objects.filter(field='I am a string, look at me')
<QuerySet []>
>>> from django.db import connection
>>> print connection.queries[-1]['sql']
SELECT "bug_m"."id", "bug_m"."field" FROM "bug_m" WHERE "bug_m"."field" =
'I am a string, look at me' LIMIT 21
}}}
{{{
SELECT "bug_m"."id", "bug_m"."field" FROM "bug_m" WHERE "bug_m"."field" =
I am a string, look at me
SELECT "bug_m"."id", "bug_m"."field" FROM "bug_m" WHERE "bug_m"."field" =
'I am a string, look at me' LIMIT 21
}}}
{{{
WHERE "bug_m"."field" = I am a string, look at me
WHERE "bug_m"."field" = 'I am a string, look at me'
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28590>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => Adiyat Mubarak
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/28590#comment:1>
Comment (by Adiyat Mubarak):
Replying to [ticket:28590 Aur Saraf]:
> Very low severity, and probably easy pickings:
>
> In various versions of Django, up to 1.11.5, with sqlite, on Windows:
>
> {{{
> class M(models.Model):
> field = models.CharField(max_length=10)
> }}}
>
> {{{
> >>> from bug import models
> >>> print models.M.objects.filter(field='I am a string, look at
me').query.__str__()
> SELECT "bug_m"."id", "bug_m"."field" FROM "bug_m" WHERE "bug_m"."field"
= I am a string, look at me
> >>> models.M.objects.filter(field='I am a string, look at me')
> <QuerySet []>
> >>> from django.db import connection
> >>> print connection.queries[-1]['sql']
> SELECT "bug_m"."id", "bug_m"."field" FROM "bug_m" WHERE "bug_m"."field"
= 'I am a string, look at me' LIMIT 21
> }}}
>
> {{{
> SELECT "bug_m"."id", "bug_m"."field" FROM "bug_m" WHERE "bug_m"."field"
= I am a string, look at me
> SELECT "bug_m"."id", "bug_m"."field" FROM "bug_m" WHERE "bug_m"."field"
= 'I am a string, look at me' LIMIT 21
> }}}
>
> {{{
> WHERE "bug_m"."field" = I am a string, look at me
> WHERE "bug_m"."field" = 'I am a string, look at me'
> }}}
Hi, this issue also occurs in my OSX and I'm using Django 1.9.6 with
MariaDB.
I'm trying to patch this, should I start from 1.11.x branch or master?
Also, I don't know where is the file located regarding this issue.
Thanks in advanced.
--
Ticket URL: <https://code.djangoproject.com/ticket/28590#comment:2>
* status: assigned => closed
* resolution: => duplicate
Comment:
Duplicate of #25705.
--
Ticket URL: <https://code.djangoproject.com/ticket/28590#comment:3>