From 4282fd468fd11a7db79307ba1c33a4960c299e4a Mon Sep 17 00:00:00 2001 From: marcperrinoptel Date: Mon, 25 Apr 2022 15:17:33 -0400 Subject: Fixed #33655 -- Removed unnecessary constant from GROUP BY clause for QuerySet.exists(). --- django/db/models/sql/query.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'django/db/models/sql/query.py') diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 64e7927f7a..1097de4f79 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -27,6 +27,7 @@ from django.db.models.expressions import ( OuterRef, Ref, ResolvedOuterRef, + Value, ) from django.db.models.fields import Field from django.db.models.fields.related_lookups import MultiColSource @@ -582,8 +583,7 @@ class Query(BaseExpression): q.clear_ordering(force=True) if limit: q.set_limits(high=1) - q.add_extra({"a": 1}, None, None, None, None, None) - q.set_extra_mask(["a"]) + q.add_annotation(Value(1), "a") return q def has_results(self, using): -- cgit v1.3