Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #34370 -- Added integer fields validation as 64-bit on SQLite. #16601

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

nabil-rady
Copy link
Contributor

Fixes 34370

mina-atef-00

This comment was marked as resolved.

@felixxm

This comment was marked as resolved.

Copy link
Member

@felixxm felixxm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nabil-rady Thanks 👍

django/db/backends/sqlite3/operations.py Show resolved Hide resolved

with self.assertRaises(ValidationError):
instance_overflow.full_clean()
instance_underflow.full_clean()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is unreachable.

django/db/backends/sqlite3/operations.py Show resolved Hide resolved
instance = self.model(value=min_value)
instance.full_clean()
instance.save()
qs = self.model.objects.filter(value__lte=min_value)
self.assertEqual(qs.count(), 1)
self.assertEqual(qs[0].value, min_value)

if max_value is not None:
if max_value <= max_documented_value:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes in test_backend_range_save looks unnecessary, please revert.

instance_underflow.full_clean()
instance_overflow = self.model(value=max_value + 1)
with self.assertRaises(ValidationError):
instance_overflow.full_clean()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_overflow_and_underflow seems unnecessary, it's already tested in test_backend_range_validation.

@nabil-rady nabil-rady force-pushed the ticket_34370 branch 3 times, most recently from 5a5cb3d to d3ffdc7 Compare March 2, 2023 12:58
@felixxm felixxm changed the title Fixes #34370 -- Fix overflow error in sqlite with integers. Fixed #34370 -- Added integer fields validation as 64-bit on SQLite. Mar 8, 2023
Copy link
Member

@felixxm felixxm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nabil-rady Thanks 👍 I added a release note.

@felixxm felixxm merged commit 32d4b61 into django:main Mar 8, 2023
@felixxm felixxm temporarily deployed to schedules March 9, 2023 02:58 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants