diff --git a/README.rst b/README.rst index e58b904d3b99..9e2b313d27a4 100644 --- a/README.rst +++ b/README.rst @@ -41,3 +41,30 @@ To run Django's test suite: * Follow the instructions in the "Unit tests" section of docs/internals/contributing/writing-code/unit-tests.txt, published online at https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/#running-the-unit-tests + +***************** +The SendBird Fork +***************** + +1.9.13 is the last minor version of upstream Django 1.9. + +1.9.14 +====== + +This version does not exist. + +1.9.15 +====== + +`Soda `_ uses this fork since v0.28. (See `sendbird/soda#6667 `_) + +* Fixed Python 3.6 deprecation warning for empty model `super()` calls. (82036a5) +* Reverted the upstream microsecond precision support (a20ce1a) +* Suppressed the upstream update of nullable `User.last_login` (1cb5bc2) + +1.9.16 +====== + +`Soda `_ uses this fork since v0.33. (See `sendbird/soda#7711 `_) + +* Re-enabled the upstream microsecond precision support. (1b55425) diff --git a/django/__init__.py b/django/__init__.py index 0bc42c5b8a70..4943fa88cbbc 100644 --- a/django/__init__.py +++ b/django/__init__.py @@ -1,6 +1,6 @@ from django.utils.version import get_version -VERSION = (1, 9, 15, 'alpha', 0) +VERSION = (1, 9, 16, 'alpha', 0) __version__ = get_version(VERSION) diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index 732eb428c3bd..03f38576646d 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -64,7 +64,7 @@ def adapt_datetime_warn_on_aware_datetime(value, conv): # This doesn't account for the database connection's timezone, # which isn't known. (That's why this adapter is deprecated.) value = value.astimezone(timezone.utc).replace(tzinfo=None) - return Thing2Literal(value.strftime("%Y-%m-%d %H:%M:%S"), conv) + return Thing2Literal(value.strftime("%Y-%m-%d %H:%M:%S.%f"), conv) # MySQLdb-1.2.1 returns TIME columns as timedelta -- they are more like # timedelta in terms of actual behavior as they are signed and include days -- @@ -151,7 +151,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): # types, as strings. Column-type strings can contain format strings; they'll # be interpolated against the values of Field.__dict__ before being output. # If a column type is set to None, it won't be included in the output. - data_types = { + _data_types = { 'AutoField': 'integer AUTO_INCREMENT', 'BinaryField': 'longblob', 'BooleanField': 'bool', @@ -179,6 +179,13 @@ class DatabaseWrapper(BaseDatabaseWrapper): 'UUIDField': 'char(32)', } + @cached_property + def data_types(self): + if self.features.supports_microsecond_precision: + return dict(self._data_types, DateTimeField='datetime(6)', TimeField='time(6)') + else: + return self._data_types + operators = { 'exact': '= %s', 'iexact': 'LIKE %s', diff --git a/django/db/backends/mysql/features.py b/django/db/backends/mysql/features.py index 8e4fc81ff4b1..6fbb5024e9d2 100644 --- a/django/db/backends/mysql/features.py +++ b/django/db/backends/mysql/features.py @@ -19,7 +19,6 @@ class DatabaseFeatures(BaseDatabaseFeatures): has_select_for_update = True has_select_for_update_nowait = False supports_forward_references = False - supports_microsecond_precision = False supports_regex_backreferencing = False supports_date_lookup_using_string = False can_introspect_autofield = True @@ -42,6 +41,12 @@ def _mysql_storage_engine(self): result = cursor.fetchone() return result[0] + @cached_property + def supports_microsecond_precision(self): + # See https://github.com/farcepest/MySQLdb1/issues/24 for the reason + # about requiring MySQLdb 1.2.5 + return self.connection.mysql_version >= (5, 6, 4) and Database.version_info >= (1, 2, 5) + @cached_property def can_introspect_foreign_keys(self): "Confirm support for introspected foreign keys"