summaryrefslogtreecommitdiff
path: root/django/db/backends/base
diff options
context:
space:
mode:
authorDavid Sanders <shang.xiao.sanders@gmail.com>2023-11-13 00:45:52 +1100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-11-13 12:01:40 +0100
commitb863c5ffde0bafa5eaa9f262103eaeb71877787c (patch)
tree3e0930b96daeddee486a2f011fd4598db3fa7e6b /django/db/backends/base
parent1b56b24f81a2e64b4bd3059abad9b6fd0c801c66 (diff)
Fixed #34967 -- Fixed queryset crash when grouping by constants on SQLite < 3.39.
On SQLite < 3.39, this forces a GROUP BY clause with a HAVING clause when no grouping is specified. Co-authored-by: Simon Charette <charette.s@gmail.com>
Diffstat (limited to 'django/db/backends/base')
-rw-r--r--django/db/backends/base/operations.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django/db/backends/base/operations.py b/django/db/backends/base/operations.py
index b1d818d90e..d5a40eb46e 100644
--- a/django/db/backends/base/operations.py
+++ b/django/db/backends/base/operations.py
@@ -231,6 +231,13 @@ class BaseDatabaseOperations:
)
return "%s"
+ def force_group_by(self):
+ """
+ Return a GROUP BY clause to use with a HAVING clause when no grouping
+ is specified.
+ """
+ return []
+
def force_no_ordering(self):
"""
Return a list used in the "ORDER BY" clause to force no ordering at