diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index 499d27d..58049ed 100644
|
a
|
b
|
class ModelAdmin(BaseModelAdmin):
|
| 668 | 668 | try: |
| 669 | 669 | object_id = field.to_python(object_id) |
| 670 | 670 | return queryset.get(**{field.name: object_id}) |
| 671 | | except (model.DoesNotExist, ValidationError, ValueError): |
| | 671 | except (model.DoesNotExist, ValidationError, ValueError, OverflowError): |
| 672 | 672 | return None |
| 673 | 673 | |
| 674 | 674 | def get_changelist_form(self, request, **kwargs): |
diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py
index 66ad278..36c1351 100644
|
a
|
b
|
class SQLiteCursorWrapper(Database.Cursor):
|
| 325 | 325 | if params is None: |
| 326 | 326 | return Database.Cursor.execute(self, query) |
| 327 | 327 | query = self.convert_query(query) |
| 328 | | return Database.Cursor.execute(self, query, params) |
| 329 | | |
| | 328 | try: |
| | 329 | return Database.Cursor.execute(self, query, params) |
| | 330 | except OverflowError: |
| | 331 | return None |
| | 332 | |
| 330 | 333 | def executemany(self, query, param_list): |
| 331 | 334 | query = self.convert_query(query) |
| 332 | 335 | return Database.Cursor.executemany(self, query, param_list) |
diff --git a/django/db/backends/sqlite3/operations.py b/django/db/backends/sqlite3/operations.py
index 47a26b5..6404ea6 100644
|
a
|
b
|
class DatabaseOperations(BaseDatabaseOperations):
|
| 122 | 122 | # Native sqlite3 cursors cannot be used as context managers. |
| 123 | 123 | try: |
| 124 | 124 | return cursor.execute(sql, params).fetchone() |
| | 125 | except OverflowError: |
| | 126 | return None |
| 125 | 127 | finally: |
| 126 | 128 | cursor.close() |
| 127 | 129 | |