summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/db/backends/mysql/operations.py2
-rw-r--r--django/db/backends/oracle/operations.py2
-rw-r--r--django/db/backends/sqlite3/operations.py2
-rw-r--r--django/db/models/expressions.py2
-rw-r--r--docs/releases/2.0.txt7
5 files changed, 8 insertions, 7 deletions
diff --git a/django/db/backends/mysql/operations.py b/django/db/backends/mysql/operations.py
index 584eb56e70..e7fc2b93bf 100644
--- a/django/db/backends/mysql/operations.py
+++ b/django/db/backends/mysql/operations.py
@@ -96,7 +96,7 @@ class DatabaseOperations(BaseDatabaseOperations):
return "TIME(%s)" % (field_name)
def date_interval_sql(self, timedelta):
- return "INTERVAL '%06f' SECOND_MICROSECOND" % (timedelta.total_seconds()), []
+ return "INTERVAL '%06f' SECOND_MICROSECOND" % timedelta.total_seconds()
def format_for_duration_arithmetic(self, sql):
if self.connection.features.supports_microsecond_precision:
diff --git a/django/db/backends/oracle/operations.py b/django/db/backends/oracle/operations.py
index 17c3d93a5c..09c0e18d84 100644
--- a/django/db/backends/oracle/operations.py
+++ b/django/db/backends/oracle/operations.py
@@ -77,7 +77,7 @@ END;
"""
NUMTODSINTERVAL converts number to INTERVAL DAY TO SECOND literal.
"""
- return "NUMTODSINTERVAL(%06f, 'SECOND')" % (timedelta.total_seconds()), []
+ return "NUMTODSINTERVAL(%06f, 'SECOND')" % timedelta.total_seconds()
def date_trunc_sql(self, lookup_type, field_name):
# https://docs.oracle.com/database/121/SQLRF/functions271.htm#SQLRF52058
diff --git a/django/db/backends/sqlite3/operations.py b/django/db/backends/sqlite3/operations.py
index 5ffc65e08a..f030c9ed99 100644
--- a/django/db/backends/sqlite3/operations.py
+++ b/django/db/backends/sqlite3/operations.py
@@ -54,7 +54,7 @@ class DatabaseOperations(BaseDatabaseOperations):
return "django_date_extract('%s', %s)" % (lookup_type.lower(), field_name)
def date_interval_sql(self, timedelta):
- return "'%s'" % duration_string(timedelta), []
+ return "'%s'" % duration_string(timedelta)
def format_for_duration_arithmetic(self, sql):
"""Do nothing since formatting is handled in the custom function."""
diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py
index e42555ed80..5cd558c12a 100644
--- a/django/db/models/expressions.py
+++ b/django/db/models/expressions.py
@@ -639,7 +639,7 @@ class DurationValue(Value):
connection.ops.check_expression_support(self)
if connection.features.has_native_duration_field:
return super().as_sql(compiler, connection)
- return connection.ops.date_interval_sql(self.value)
+ return connection.ops.date_interval_sql(self.value), []
class RawSQL(Expression):
diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt
index 8dfc43c24d..3985f158fd 100644
--- a/docs/releases/2.0.txt
+++ b/docs/releases/2.0.txt
@@ -323,9 +323,10 @@ This section describes changes that may be needed in third-party database
backends.
* The ``DatabaseOperations.datetime_cast_date_sql()``,
- ``datetime_cast_time_sql()``, ``datetime_trunc_sql()``, and
- ``datetime_extract_sql()`` methods now return only the SQL to perform the
- operation instead of SQL and a list of parameters.
+ ``datetime_cast_time_sql()``, ``datetime_trunc_sql()``,
+ ``datetime_extract_sql()``, and ``date_interval_sql()`` methods now return
+ only the SQL to perform the operation instead of SQL and a list of
+ parameters.
* Third-party database backends should add a ``DatabaseWrapper.display_name``
attribute with the name of the database that your backend works with. Django