summaryrefslogtreecommitdiff
path: root/django/db/backends/mysql/operations.py
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2020-02-27 00:34:37 -0500
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-02-27 08:50:55 +0100
commit41ebe60728a15aa273f4d70de92f5246a89c3d4e (patch)
tree1a3bb1e641a2b28e02d100a3f8ca998a7687cd6e /django/db/backends/mysql/operations.py
parentf1016814d84b1423cfe0df85644c9870a6bc6b41 (diff)
downloaddjango-41ebe60728a15aa273f4d70de92f5246a89c3d4e.tar.gz
Fixed #31312 -- Properly ordered temporal subtraction params on MySQL.
Regression in 9bcbcd599abac91ea853b2fe10b784ba32df043e. Thanks rick2ricks for the report.
Diffstat (limited to 'django/db/backends/mysql/operations.py')
-rw-r--r--django/db/backends/mysql/operations.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/backends/mysql/operations.py b/django/db/backends/mysql/operations.py
index 5342957767..6aaf5c6295 100644
--- a/django/db/backends/mysql/operations.py
+++ b/django/db/backends/mysql/operations.py
@@ -291,7 +291,7 @@ class DatabaseOperations(BaseDatabaseOperations):
"((TIME_TO_SEC(%(lhs)s) * 1000000 + MICROSECOND(%(lhs)s)) -"
" (TIME_TO_SEC(%(rhs)s) * 1000000 + MICROSECOND(%(rhs)s)))"
) % {'lhs': lhs_sql, 'rhs': rhs_sql}, tuple(lhs_params) * 2 + tuple(rhs_params) * 2
- params = (*lhs_params, *rhs_params)
+ params = (*rhs_params, *lhs_params)
return "TIMESTAMPDIFF(MICROSECOND, %s, %s)" % (rhs_sql, lhs_sql), params
def explain_query_prefix(self, format=None, **options):