diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index bf3b63f100..9ac0d0c960 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -1491,12 +1491,12 @@ class Query(object): clamped to any existing high value. """ if high is not None: - if self.high_mark: + if self.high_mark is not None: self.high_mark = min(self.high_mark, self.low_mark + high) else: self.high_mark = self.low_mark + high if low is not None: - if self.high_mark: + if self.high_mark is not None: self.low_mark = min(self.high_mark, self.low_mark + low) else: self.low_mark = self.low_mark + low diff --git a/tests/regressiontests/queries/models.py b/tests/regressiontests/queries/models.py index 2f027f8d36..e5d17c0aaf 100644 --- a/tests/regressiontests/queries/models.py +++ b/tests/regressiontests/queries/models.py @@ -862,6 +862,8 @@ used in lookups. Bug #7698 -- People like to slice with '0' as the high-water mark. >>> Item.objects.all()[0:0] [] +>>> Item.objects.all()[0:0][:10] +[] Bug #7411 - saving to db must work even with partially read result set in another cursor.