#32699: Comparisons using TruncTime are unreliable in MySQL
-------------------------------+------------------------------------
     Reporter:  Alex Hill      |                    Owner:  nobody
         Type:  Bug            |                   Status:  new
    Component:  Uncategorized  |                  Version:  3.2
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Accepted
    Has patch:  1              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+------------------------------------

Comment (by Simon Charette):

 Not sure I can explain that, maybe that MySQL wanted preserve the equality
 behaviour or `TIME` for columns without microsecond precision when it
 introduced support for the later?

 {{{#!sql
 mysql> SELECT t = TIME('10:30:00.00000'), t = '10:30:00.00000', TIME(t) =
 TIME(t6), t = 103000.00, TIME(t) = 103000.00 FROM foo;
 
+----------------------------+----------------------+--------------------+---------------+---------------------+
 | t = TIME('10:30:00.00000') | t = '10:30:00.00000' | TIME(t) = TIME(t6) |
 t = 103000.00 | TIME(t) = 103000.00 |
 
+----------------------------+----------------------+--------------------+---------------+---------------------+
 |                          1 |                    1 |                  1 |
 1 |                   1 |
 
+----------------------------+----------------------+--------------------+---------------+---------------------+
 }}}

 Given that `TIME('10:30:000000') = TIME('10:30')` an alternative to the
 patch could be always wrap `TIME` comparison in the `TIME` function on
 MySQL.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32699#comment:3>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.ca285b83be5465197b7df86d3e1461b5%40djangoproject.com.

Reply via email to