Skip to content

Commit f99017c

Browse files
committed
fix overflow on IntegerField lookups
1 parent 34e6e64 commit f99017c

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.github/workflows/test-python.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ jobs:
7676
model_fields.test_decimalfield
7777
model_fields.test_charfield
7878
model_fields.test_floatfield
79+
model_fields.test_integerfield
7980
model_fields.test_textfield
8081
model_fields.test_uuid
8182
or_lookups

django_mongodb/features.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
4949
"model_fields.test_uuid.TestQuerying.test_istartswith",
5050
"model_fields.test_uuid.TestQuerying.test_startswith",
5151
},
52+
"QuerySet.update() with expression not supported.": {
53+
"model_fields.test_integerfield.PositiveIntegerFieldTests.test_negative_values",
54+
},
5255
}

django_mongodb/query.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import re
22
from functools import wraps
33

4+
from django.core.exceptions import FullResultSet
45
from django.db import DatabaseError, IntegrityError, NotSupportedError
56
from django.db.models.lookups import UUIDTextMixin
67
from django.db.models.query import QuerySet
@@ -170,7 +171,10 @@ def add_filters(self, filters, query=None):
170171

171172
continue
172173

173-
field, lookup_type, value = self._decode_child(child)
174+
try:
175+
field, lookup_type, value = self._decode_child(child)
176+
except FullResultSet:
177+
continue
174178

175179
column = field.column
176180
existing = subquery.get(column)

0 commit comments

Comments
 (0)