Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#17174 closed New feature (fixed)

The docs should mention, that MySql doesn't support microseconds

Reported by: jammon Owned by: Dan Poirier
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

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).

Attachments (1)

17174.diff (596 bytes ) - added by Dan Poirier 13 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by jammon, 13 years ago

Maybe we should add even more sharply, that the precision is truncated to seconds. (There are no milliseconds either.)

comment:2 by Aymeric Augustin, 13 years ago

Owner: changed from nobody to Aymeric Augustin
Status: newassigned

comment:3 by Aymeric Augustin, 13 years ago

Owner: changed from Aymeric Augustin to nobody
Status: assignednew
Triage Stage: UnreviewedAccepted

comment:4 by Dan Poirier, 13 years ago

Owner: changed from nobody to Dan Poirier
Status: newassigned

by Dan Poirier, 13 years ago

Attachment: 17174.diff added

comment:5 by Dan Poirier, 13 years ago

Easy pickings: set
Has patch: set

comment:6 by Karen Tracey, 13 years ago

Resolution: fixed
Status: assignedclosed

In [17095]:

Fix #17174: Add note in the supported databases notes that MySQL can't conceive of a time unit smaller than a second. Thanks jammon and poirier.

comment:7 by sarang (@…, 11 years ago

MySQL does support microseconds now (starting with version 5.6.4). Follow this ticket for more details: https://code.djangoproject.com/ticket/19716

Note: See TracTickets for help on using tickets.
Back to Top