#34125: Limitting QuerySet crashes on union() with a single non-empty query
-------------------------------------+-------------------------------------
Reporter: Stefan Hammer | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by bcail):
* cc: bcail (added)
Comment:
Using the following diff:
{{{
diff --git a/tests/queries/tests.py b/tests/queries/tests.py
index 5163fc5cb1..31651df114 100644
--- a/tests/queries/tests.py
+++ b/tests/queries/tests.py
@@ -3199,6 +3199,11 @@ class UnionTests(unittest.TestCase):
)
self.check_union(ObjectB, Q1, Q2)
+ def test_union_empty_queryset(self):
+ q1 = ObjectA.objects.all().order_by()
+ q2 = q1.union(ObjectA.objects.none())
+ print(q2.order_by()[:1])
+
class DefaultValuesInsertTest(TestCase):
def test_no_extra_params(self):
}}}
git bisect says that 3d734c09ff0138441dfe0a59010435871d17950f is the first
bad commit.
--
Ticket URL: <https://code.djangoproject.com/ticket/34125#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701841b44a8f2-4d0fe833-a82e-40bb-a7ad-221e604cd1c2-000000%40eu-central-1.amazonses.com.