Opened 12 years ago
Closed 2 years ago
#19884 closed Bug (fixed)
Inspectdb on Oracle doesn't produce correct field types
Reported by: | Anssi Kääriäinen | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.9 |
Severity: | Normal | Keywords: | |
Cc: | felisiak.mariusz@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
The test inspectdb.test_field_types() has multiple errors, at least:
CharField lengths not correctly inspected (returns double the length of generated field)FloatField not correctly inspected (returns DecimalField with max_digits=-127)- DateTimeField is inspected as TimeField (cannot be distinguished)
Getting all these to work correctly will be somewhat hard. So, the suggested short-term fix is to just mark the test as expectedFailure on Oracle. Inspectdb isn't high-priority as the output should be hand-edited in any case.
Change History (14)
comment:1 by , 12 years ago
comment:3 by , 11 years ago
I just posted PR 2225 which breaks inspectdb.test_field_types()
in two: a test_number_field_types()
which passes (the PR includes a fix to the FloatField issue), and test_field_types()
which does all the rest and is still marked expectedFailure; most of the fields tested there are CharFields under Oracle, so fixing makes little sense indeed.
comment:5 by , 11 years ago
Description: | modified (diff) |
---|
comment:9 by , 9 years ago
Version: | 1.4 → 1.9 |
---|
comment:10 by , 9 years ago
Because this problem is still present in 1.9 I updated the version number
comment:12 by , 8 years ago
Cc: | added |
---|---|
Description: | modified (diff) |
comment:14 by , 2 years ago
Description: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Both DateTimeField
and TimeField
use exactly the same datatype i.e. TIMESTAMP
, they cannot be distinguished in introspection. IMO, we can treat this ticket as fixed.
In f565c6f9994b2559a5164dc709a926eac7ebd5fe: