mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
[3.1.x] Fixed #31584 -- Fixed crash when chaining values()/values_list() after Exists() annotation and aggregation on Oracle.
Oracle requires the EXISTS expression to be wrapped in a CASE WHEN in the GROUP BY clause. Regression inefa1908f66. Backport of3a941230c8from master
This commit is contained in:
committed by
Carlton Gibson
parent
bebb7d4d7e
commit
b46b0f80e8
@@ -1,9 +1,7 @@
|
||||
import datetime
|
||||
from decimal import Decimal
|
||||
from unittest import skipIf
|
||||
|
||||
from django.core.exceptions import FieldDoesNotExist, FieldError
|
||||
from django.db import connection
|
||||
from django.db.models import (
|
||||
BooleanField, CharField, Count, DateTimeField, Exists, ExpressionWrapper,
|
||||
F, Func, IntegerField, Max, NullBooleanField, OuterRef, Q, Subquery, Sum,
|
||||
@@ -623,7 +621,6 @@ class NonAggregateAnnotationTestCase(TestCase):
|
||||
).values('name')
|
||||
self.assertCountEqual(publisher_books_qs, [{'name': 'Sams'}, {'name': 'Morgan Kaufmann'}])
|
||||
|
||||
@skipIf(connection.vendor == 'oracle', 'See https://code.djangoproject.com/ticket/31584')
|
||||
def test_annotation_exists_aggregate_values_chaining(self):
|
||||
qs = Book.objects.values('publisher').annotate(
|
||||
has_authors=Exists(Book.authors.through.objects.filter(book=OuterRef('pk'))),
|
||||
|
||||
Reference in New Issue
Block a user