Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#7536 closed (fixed)

mysql inspectdb unable to handle newdecimal

Reported by: Jerome Etienne <jerome.etienne@…> Owned by: nobody
Component: django-admin.py inspectdb Version: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Description:
doing inspectdb on a mysql newdecimal field is converted as a TextField instead of a decimal.

mysql 5 got a type "newdecimal" MYSQL_TYPE_NEWDECIMAL) and this is not handled by django inspectdb.

DATA_TYPES_REVERSE in mysql introspection.py doesnt contains the FIELD_TYPE.NEWDECIMAL from mysqldb-python. So in DATA_TYPE_REVERSE, i just added

    FIELD_TYPE.NEWDECIMAL: 'DecimalField',

the patch is attached

Attachments (1)

patch_django (417 bytes) - added by Jerome Etienne <jerome.etienne@…> 7 years ago.

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by Jerome Etienne <jerome.etienne@…>

comment:1 Changed 7 years ago by ericholscher

  • milestone set to 1.0
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 7 years ago by ubernostrum

Does MySQLdb support this, and if so what's the oldest version that does support it?

comment:3 Changed 7 years ago by ubernostrum

  • Triage Stage changed from Accepted to Ready for checkin

nm, just checked on 1.2.1 and it works.

comment:4 Changed 7 years ago by brosner

  • Resolution set to fixed
  • Status changed from new to closed

(In [8475]) Fixed #7536 -- Added NEWDECIMAL to introspection types in the mysql backend. Thanks Jerome Etienne for the patch.

comment:5 Changed 4 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

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