Opened 15 years ago
Closed 11 years ago
#11998 closed Bug (duplicate)
IntegerField not validated for overflow
Reported by: | Owned by: | Tobias McNulty | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.4 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | yes |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Let be this small model :
class IntegerOverflowTest(models.Model): someint = models.IntegerField()
For mysql, maximum values for signed integer is 2147483647 [1]
In admin interface, defining a value more than the maximum raises this exception :
Warning : Out of range value for column 'someint' at row 1
I would have expected that the form to be validated and prompt the error gracefully.
[1] http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html
Change History (11)
comment:1 by , 15 years ago
comment:3 by , 15 years ago
Component: | Uncategorized → Database layer (models, ORM) |
---|
comment:4 by , 15 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:5 by , 15 years ago
Resolution: | → duplicate |
---|---|
Status: | assigned → closed |
This sounds like model validation to me.. closing as duplicate of #6845
comment:7 by , 12 years ago
Easy pickings: | unset |
---|---|
Severity: | → Normal |
Type: | → Uncategorized |
UI/UX: | unset |
Version: | 1.1 → 1.4 |
Problem persists in 1.4.1
comment:8 by , 12 years ago
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
Type: | Uncategorized → Bug |
Problem persists in 1.4.2
Following fields also raise same exception.
- BigIntegerField
- PositiveIntegerField
- PositiveSmallIntegerField
- SmallIntegerField
follow-up: 10 comment:9 by , 12 years ago
Needs documentation: | set |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
Triage Stage: | Unreviewed → Accepted |
comment:10 by , 11 years ago
Resolution: | fixed |
---|---|
Status: | closed → new |
Triage Stage: | Accepted → Unreviewed |
Replying to baltazarfo@…:
Just checked with 1.4.6 and this seems to still be an issue with postgresql at least. Checked the code and I don't see any validators being added. I assume any fix for this would raise a ValidationError or like BigIntegerField pass min_value or max_value to the form field.
I can write a failing test if that helps.
A small note : this warning is not raised while using sqlite3. It's reproducible under at least mysql.