diff options
| author | Claude Paroz <claude@2xlibre.net> | 2014-10-11 14:47:54 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2014-10-28 15:06:58 +0100 |
| commit | 713f23492a52df8dbb4ae1175f5d0a0f3e2c4005 (patch) | |
| tree | 97aec19af241b0098290f02d80a74548b80723be /docs/ref/databases.txt | |
| parent | 22da5f8817ffff3917bcf8a652dce84f382c9202 (diff) | |
Required MySQLdb >= 1.2.5 for fractional seconds support
On MySQLdb < 1.2.5, MySQLdb returns None when fetching datetime/time
values with fractional seconds.
See https://github.com/farcepest/MySQLdb1/issues/24
Diffstat (limited to 'docs/ref/databases.txt')
| -rw-r--r-- | docs/ref/databases.txt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt index 63cb5f279e..f129058e98 100644 --- a/docs/ref/databases.txt +++ b/docs/ref/databases.txt @@ -503,7 +503,11 @@ Fractional seconds support for Time and DateTime fields MySQL 5.6.4 and later can store fractional seconds, provided that the column definition includes a fractional indication (e.g. ``DATETIME(6)``). -Earlier versions do not support them at all. +Earlier versions do not support them at all. In addition, versions of MySQLdb +older than 1.2.5 have `a bug`_ that also prevents the use of fractional seconds +with MySQL. + +.. _a bug: https://github.com/farcepest/MySQLdb1/issues/24 Django will not upgrade existing columns to include fractional seconds if the database server supports it. If you want to enable them on an existing database, @@ -521,7 +525,8 @@ or using a :class:`~django.db.migrations.operations.RunSQL` operation in a ``time`` values when using the MySQL backend. Now it lets the database decide whether it should drop that part of the value or not. By default, new ``DateTimeField`` or ``TimeField`` columns are now created with fractional - seconds support on MySQL 5.6.4 or later. + seconds support on MySQL 5.6.4 or later with either mysqlclient or + MySQLdb 1.2.5 or later. ``TIMESTAMP`` columns ~~~~~~~~~~~~~~~~~~~~~ |
