#7074: MySQL error/warning when 'gt' field lookup with a datetime field and
fulltext search.
-------------------------------------+-------------------------------------
     Reporter:  anonymous            |                    Owner:
         Type:  Bug                  |  anubhav9042
    Component:  Database layer       |                   Status:  assigned
  (models, ORM)                      |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  qsrf-cleanup mysql,  |             Triage Stage:  Accepted
  fulltext search, gt                |      Needs documentation:  0
    Has patch:  0                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by anubhav9042):

 models.py
 {{{
 from django.db import models

 class Test(models.Model):
         name = models.CharField(max_length=40)
         created = models.DateField()
         created2 = models.DateTimeField()
 }}}

 shell:
 {{{
 In [1]: from t19508.models import *

 In [2]: import datetime

 In [3]: d = datetime.datetime.now()

 In [4]: d2 = d.date()

 In [5]: t=Test.objects.using('mysql').create(name='anubhav',
 created=d.date(), created2=d)

 In [6]: t=Test.objects.using('mysql').filter(created2__gte="2008-04-23
 14:39:36.133203")

 In [7]: t[0].created
 Out[7]: datetime.date(2014, 7, 28)

 In [8]: t[0].created2
 Out[8]: datetime.datetime(2014, 7, 28, 23, 36, 13, tzinfo=<UTC>)

 In [9]:
 
t=Test.objects.using('mysql').filter(name__search="anubhav").filter(created2__gte="2008-04-23
 14:39:36.133203")

 In [10]: t[0].created
 Out[10]: datetime.date(2014, 7, 28)

 In [11]: t[0].created2
 Out[11]: datetime.datetime(2014, 7, 28, 23, 36, 13, tzinfo=<UTC>)

 }}}

 I think that the problem now doesn't exists.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/7074#comment:22>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.af78fdd36754d6c03e2ab14082addf55%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to