#26824: MySQL query with CONVERT_TZ is not properly formated
-------------------------------------+-------------------------------------
     Reporter:  truhlik              |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.9
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  mysql, timezone      |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by timgraham):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 Can you try to construct a test for Django's test suite? A found
 
[https://github.com/django/django/blob/12b4280444b58c94197255655e284e4103fe00a9/tests/model_fields/test_datetimefield.py#L50-L70
 a similar one] which generates this query:

 {{{ #!sql
 SELECT `model_fields_datetimemodel`.`id`,
 `model_fields_datetimemodel`.`d`, `model_fields_datetimemodel`.`dt`,
 `model_fields_datetimemodel`.`t`
 FROM `model_fields_datetimemodel`
 WHERE DATE(CONVERT_TZ(`model_fields_datetimemodel`.`dt`, 'UTC',
 America/Vancouver)) = 2014-03-12
 }}}

 Does it pass for you? Which version of MySQL are you using?

 Did you load the [https://docs.djangoproject.com/en/stable/ref/databases
 /#time-zone-definitions MySQL timezone definitions]?

--
Ticket URL: <https://code.djangoproject.com/ticket/26824#comment:1>
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/065.4a12dcc69167283ff72f0b3bd4b2c26f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to