The docs should mention, that MySql doesn't support microseconds
MySQL doesn't store the microsecond part of a TimeField or DateTimeField, which is accounted for in the code (in django/db/backends/mysql/base.py). But the documentation doesn't mention this limitation.
Suggestion: Add this sentence to /en/dev/ref/databases -> MySQL Notes -> Notes on specific fields -> DateTime fields:
MySQL does not support storing the microsecond part of a TimeField or DateTimeField,
so the microsecond part of the data is truncated (set to zero).
(It cost me quite some time to find out, why the integration tests failed on the staging server. I couldn't believe, that MySQL has such a limitation. See the bug report from Feb 2005 (!) http://bugs.mysql.com/bug.php?id=8523).
Change History
(8)
Owner: |
changed from nobody to Aymeric Augustin
|
Status: |
new → assigned
|
Owner: |
changed from Aymeric Augustin to nobody
|
Status: |
assigned → new
|
Triage Stage: |
Unreviewed → Accepted
|
Owner: |
changed from nobody to Dan Poirier
|
Status: |
new → assigned
|
Easy pickings: |
set
|
Has patch: |
set
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
Maybe we should add even more sharply, that the precision is truncated to seconds. (There are no milliseconds either.)