Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#7536 closed (fixed)

mysql inspectdb unable to handle newdecimal

Reported by: Jerome Etienne <jerome.etienne@…> Owned by: nobody
Component: 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:


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 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@…> 8 years ago.

Download all attachments as: .zip

Change History (6)

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

Attachment: patch_django added

comment:1 Changed 8 years ago by Eric Holscher

milestone: 1.0
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

comment:2 Changed 8 years ago by James Bennett

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

comment:3 Changed 8 years ago by James Bennett

Triage Stage: AcceptedReady for checkin

nm, just checked on 1.2.1 and it works.

comment:4 Changed 8 years ago by Brian Rosner

Resolution: fixed
Status: newclosed

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

comment:5 Changed 5 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

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