Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#25767 closed Bug (fixed)

integer_field_ranges are incorrect for MySQL backend

Reported by: George Marshall Owned by: George Marshall
Component: Database layer (models, ORM) Version: 1.8
Severity: Normal Keywords:
Cc: Simon Charette Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description (last modified by George Marshall)

The integer ranges for PositiveSmallIntegerField and PositiveIntegerField are reflective of UNSIGNED INT and UNSIGNED BIGINT. When the ORM actually uses UNSIGNED SMALLINT and UNSIGNED INT when creating these fields.

The side effect of this is that data will pass validation checks, but will be munged by the database.

Change History (9)

comment:1 Changed 5 years ago by George Marshall

Owner: changed from nobody to George Marshall
Status: newassigned

comment:2 Changed 5 years ago by Simon Charette

Triage Stage: UnreviewedAccepted

Since this a bug in a new feature (introduced in 1.8) that can possibly lead to data loss I think this is worth a backport.

comment:3 Changed 5 years ago by Simon Charette

Cc: Simon Charette added

comment:4 Changed 5 years ago by George Marshall

Description: modified (diff)

comment:5 Changed 5 years ago by Tim Graham

Has patch: set
Patch needs improvement: set

Tests aren't passing on the pull request and I left some comments for improvement.

comment:6 Changed 5 years ago by George Marshall

The CI server seems to have crashed out, needs to be rerun.

comment:7 Changed 5 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 710e11d0:

Fixed #25767 -- Fixed data truncation possibility with Positive(Small)IntegerField on MySQL.

comment:8 Changed 5 years ago by Tim Graham <timograham@…>

In 11d54e8f:

[1.9.x] Fixed #25767 -- Fixed data truncation possibility with Positive(Small)IntegerField on MySQL.

Backport of 710e11d076b9e5ef3e3b486dfb70bb55b788691c from master

comment:9 Changed 5 years ago by Tim Graham <timograham@…>

In 581b9e5:

[1.8.x] Fixed #25767 -- Fixed data truncation possibility with Positive(Small)IntegerField on MySQL.

Backport of 710e11d076b9e5ef3e3b486dfb70bb55b788691c from master

Note: See TracTickets for help on using tickets.
Back to Top