From cbb9f629b88d97dd9a3f8d425fd56c8b80d7cddf Mon Sep 17 00:00:00 2001 From: Honza Kral Date: Sun, 24 Feb 2013 12:38:32 +0100 Subject: [PATCH] Revert "fixes #19263" - Fails if not SQLite This reverts commit 2b76f19f2b89ac96bae2a169d71b23553c8101c7. --- django/db/models/sql/where.py | 4 ---- tests/regressiontests/queries/tests.py | 15 --------------- 2 files changed, 19 deletions(-) diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py index 603ae3dfbe..ef856893b5 100644 --- a/django/db/models/sql/where.py +++ b/django/db/models/sql/where.py @@ -204,10 +204,6 @@ class WhereNode(tree.Node): raise EmptyResultSet if extra: return ('%s IN %s' % (field_sql, extra), params) - if not params: - # Empty params would generate invalid sql in subquery - raise EmptyResultSet - max_in_list_size = connection.ops.max_in_list_size() if max_in_list_size and len(params) > max_in_list_size: # Break up the params list into an OR of manageable chunks. diff --git a/tests/regressiontests/queries/tests.py b/tests/regressiontests/queries/tests.py index c241c81fab..82a8de08be 100644 --- a/tests/regressiontests/queries/tests.py +++ b/tests/regressiontests/queries/tests.py @@ -2021,9 +2021,6 @@ class WeirdQuerysetSlicingTests(BaseQuerysetTest): Article.objects.create(name='three', created=datetime.datetime.now()) Article.objects.create(name='four', created=datetime.datetime.now()) - food = Food.objects.create(name='spam') - Eaten.objects.create(meal='spam with eggs', food=food) - def test_tickets_7698_10202(self): # People like to slice with '0' as the high-water mark. self.assertQuerysetEqual(Article.objects.all()[0:0], []) @@ -2039,18 +2036,6 @@ class WeirdQuerysetSlicingTests(BaseQuerysetTest): # ticket #12192 self.assertNumQueries(0, lambda: list(Number.objects.all()[1:1])) - def test_empty_sliced_subquery(self): - # ticket #19263 - testing subqueries - self.assertEqual( - Eaten.objects.filter(food__in=Food.objects.all()[0:0]).count(), - 0) - - def test_empty_sliced_subquery_exclude(self): - # ticket #19263 - testing subqueries - self.assertEqual( - Eaten.objects.exclude(food__in=Food.objects.all()[0:0]).count(), - 1) - class EscapingTests(TestCase): def test_ticket_7302(self):