id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 28378 QuerySet.union() with queryset that raises EmptyResultSet results in an empty set Jon Dufresne Mariusz Felisiak "Similar and followup to ticket #28293. Tested on Django 1.11.3. As QuerySet.union() uses the SQL UNION operator, I would expect ""SET1 UNION "" to result in SET1. If the empty set is the results of [https://github.com/django/django/blob/5b450b84e14f42302f58ec1f15a67a368e64d85c/django/db/models/sql/where.py#L97 EmpytResultSet being raised], the `.union()` result is an empty set, not SET1. Example test case: {{{ >>> import django >>> django.__version__ '1.11.3' >>> from django.contrib.auth.models import User >>> qs1 = User.objects.all() >>> qs1.count() 100 >>> qs2 = User.objects.filter(pk__in=[]) >>> qs2.count() 0 >>> list(qs1.union(qs2)) [] }}}" Bug closed Database layer (models, ORM) 1.11 Release blocker fixed Mariusz Felisiak Ready for checkin 1 0 0 0 0 0