Django

Code

Ticket #11998 (closed: duplicate)

Opened 5 months ago

Last modified 3 months ago

IntegerField not validated for overflow

Reported by: francis.giraldeau@revolutionlinux.com Assigned to: tobias
Milestone: 1.2 Component: Database layer (models, ORM)
Version: 1.1 Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description (Last modified by Alex)

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

Attachments

Change History

10/08/09 10:19:07 changed by francis.giraldeau@revolutionlinux.com

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

A small note : this warning is not raised while using sqlite3. It's reproducible under at least mysql.

10/08/09 11:14:19 changed by Alex

  • description changed.

Please use preview.

10/18/09 05:10:51 changed by thejaswi_puthraya

  • component changed from Uncategorized to Database layer (models, ORM).

12/13/09 11:41:45 changed by tobias

  • owner changed from nobody to tobias.
  • status changed from new to assigned.

12/13/09 13:07:42 changed by tobias

  • status changed from assigned to closed.
  • resolution set to duplicate.

This sounds like model validation to me.. closing as duplicate of #6845


Add/Change #11998 (IntegerField not validated for overflow)




Change Properties
Action