mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Refs #31445 -- Added test for nesting QuerySet.union().
This was fixed in MySQL 8.0.31.
This commit is contained in:
parent
a91e59e4a0
commit
96bc4254ee
@ -154,6 +154,16 @@ class DatabaseFeatures(BaseDatabaseFeatures):
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
if self.connection.mysql_version < (8, 0, 31):
|
||||||
|
skips.update(
|
||||||
|
{
|
||||||
|
"Nesting of UNIONs at the right-hand side is not supported on "
|
||||||
|
"MySQL < 8.0.31": {
|
||||||
|
"queries.test_qs_combinators.QuerySetSetOperationTests."
|
||||||
|
"test_union_nested"
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
return skips
|
return skips
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
|
@ -114,6 +114,15 @@ class QuerySetSetOperationTests(TestCase):
|
|||||||
[1, 2, 3, 4, 6, 7, 8, 9, 10, None],
|
[1, 2, 3, 4, 6, 7, 8, 9, 10, None],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_union_nested(self):
|
||||||
|
qs1 = Number.objects.all()
|
||||||
|
qs2 = qs1.union(qs1)
|
||||||
|
self.assertNumbersEqual(
|
||||||
|
qs1.union(qs2),
|
||||||
|
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
|
||||||
|
ordered=False,
|
||||||
|
)
|
||||||
|
|
||||||
@skipUnlessDBFeature("supports_select_intersection")
|
@skipUnlessDBFeature("supports_select_intersection")
|
||||||
def test_intersection_with_empty_qs(self):
|
def test_intersection_with_empty_qs(self):
|
||||||
qs1 = Number.objects.all()
|
qs1 = Number.objects.all()
|
||||||
|
Loading…
Reference in New Issue
Block a user