[Django] #19884: Inspectdb on Oracle doesn't produce correct field types

38 views
Skip to first unread message

Django

unread,
Feb 22, 2013, 2:55:27 PM2/22/13
to django-...@googlegroups.com
#19884: Inspectdb on Oracle doesn't produce correct field types
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: Bug | Status: new
Component: Database | Version: 1.4
layer (models, ORM) | Keywords:
Severity: Normal | Has patch: 0
Triage Stage: Accepted | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 0 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
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

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/19884>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 22, 2013, 5:36:01 PM2/22/13
to django-...@googlegroups.com
#19884: Inspectdb on Oracle doesn't produce correct field types
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.4
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by Anssi Kääriäinen <akaariai@…>):

In [changeset:"f565c6f9994b2559a5164dc709a926eac7ebd5fe"]:
{{{
#!CommitTicketReference repository=""
revision="f565c6f9994b2559a5164dc709a926eac7ebd5fe"
Marked a test as expected failure. Refs #19884
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/19884#comment:1>

Django

unread,
Jan 29, 2014, 11:10:56 AM1/29/14
to django-...@googlegroups.com
#19884: Inspectdb on Oracle doesn't produce correct field types
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.4
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by Shai Berger <shai@…>):

In [changeset:"ad975c64fcdf3faa67cacd51665c4f95a2c5b060"]:
{{{
#!CommitTicketReference repository=""
revision="ad975c64fcdf3faa67cacd51665c4f95a2c5b060"
Made Oracle introspect boolean fields

Fixed failing test
schema.tests.SchemaTests.test_add_field_temp_default_boolean
Refs #19884
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/19884#comment:2>

Django

unread,
Jan 29, 2014, 1:08:42 PM1/29/14
to django-...@googlegroups.com
#19884: Inspectdb on Oracle doesn't produce correct field types
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.4
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by shai):

I just posted [https://github.com/django/django/pull/2225/files 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/19884#comment:3>

Django

unread,
Jan 29, 2014, 5:42:29 PM1/29/14
to django-...@googlegroups.com
#19884: Inspectdb on Oracle doesn't produce correct field types
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.4
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by Shai Berger <shai@…>):

In [changeset:"e9d12bae1e59e51738c11c492c620f56f96106bf"]:
{{{
#!CommitTicketReference repository=""
revision="e9d12bae1e59e51738c11c492c620f56f96106bf"
Made Oracle introspect FloatFields correctly

Broke InspectDBTestCase.test_field_types in two:
- a test_number_field_types, which now passes on Oracle too
- a test_field_types, for all non-numeric fields, which is still expected
to fail

Also made some pep8 fixes in the tests file. Refs #19884

Thanks Tim Graham for review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/19884#comment:4>

Django

unread,
Jan 29, 2014, 5:49:24 PM1/29/14
to django-...@googlegroups.com
#19884: Inspectdb on Oracle doesn't produce correct field types
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.4
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Description changed by shai:

Old description:

> 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
>
> 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.

New description:

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

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.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/19884#comment:5>

Django

unread,
Jan 29, 2014, 6:59:46 PM1/29/14
to django-...@googlegroups.com
#19884: Inspectdb on Oracle doesn't produce correct field types
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.4
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by Shai Berger <shai@…>):

In [changeset:"0573120cb406066041b0235a3912dc38bc9f10ef"]:
{{{
#!CommitTicketReference repository=""
revision="0573120cb406066041b0235a3912dc38bc9f10ef"
[1.6.x] Made Oracle introspect boolean fields

Refs #19884

Backport of ad975c64fc from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/19884#comment:6>

Django

unread,
Jan 29, 2014, 6:59:46 PM1/29/14
to django-...@googlegroups.com
#19884: Inspectdb on Oracle doesn't produce correct field types
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.4
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by Shai Berger <shai@…>):

In [changeset:"5f42c0219550b62e62db6e0f3834671a994e3cd8"]:
{{{
#!CommitTicketReference repository=""
revision="5f42c0219550b62e62db6e0f3834671a994e3cd8"
[1.6.x] Made Oracle introspect FloatFields correctly

Broke InspectDBTestCase.test_field_types in two:
- a test_number_field_types, which now passes on Oracle too
- a test_field_types, for all non-numeric fields, which is still expected
to fail

Also made some pep8 fixes in the tests file. Refs #19884

Thanks Tim Graham for review.

Backport of e9d12ba from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/19884#comment:7>

Django

unread,
May 8, 2014, 8:48:23 PM5/8/14
to django-...@googlegroups.com
#19884: Inspectdb on Oracle doesn't produce correct field types
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.4
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by shai):

#17202 was closed as a duplicate of this bug.

--
Ticket URL: <https://code.djangoproject.com/ticket/19884#comment:8>

Django

unread,
Dec 23, 2015, 3:44:20 AM12/23/15
to django-...@googlegroups.com
#19884: Inspectdb on Oracle doesn't produce correct field types
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by JorisBenschop):

* version: 1.4 => 1.9


--
Ticket URL: <https://code.djangoproject.com/ticket/19884#comment:9>

Django

unread,
Dec 23, 2015, 3:44:45 AM12/23/15
to django-...@googlegroups.com
#19884: Inspectdb on Oracle doesn't produce correct field types
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by JorisBenschop):

Because this problem is still present in 1.9 I updated the version number

--
Ticket URL: <https://code.djangoproject.com/ticket/19884#comment:10>

Django

unread,
Dec 19, 2016, 8:32:10 AM12/19/16
to django-...@googlegroups.com
#19884: Inspectdb on Oracle doesn't produce correct field types
-------------------------------------+-------------------------------------
Reporter: Anssi Kääriäinen | Owner: nobody
Type: Bug | Status: new

Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"3e43d24ad36d45cace57e6a7efd34638577ae744" 3e43d24]:
{{{
#!CommitTicketReference repository=""
revision="3e43d24ad36d45cace57e6a7efd34638577ae744"
Refs #19884 -- Added CharField max_length introspection on Oracle.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/19884#comment:11>

Django

unread,
Dec 19, 2016, 2:49:32 PM12/19/16
to django-...@googlegroups.com
#19884: Inspectdb on Oracle doesn't produce correct field types
-------------------------------------+-------------------------------------
Reporter: Anssi Kääriäinen | Owner: nobody
Type: Bug | Status: new

Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* cc: felisiak.mariusz@… (added)


Old description:

> 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
>
> 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.

New description:

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

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.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/19884#comment:12>

Django

unread,
Dec 19, 2016, 4:16:41 PM12/19/16
to django-...@googlegroups.com
#19884: Inspectdb on Oracle doesn't produce correct field types
-------------------------------------+-------------------------------------
Reporter: Anssi Kääriäinen | Owner: nobody
Type: Bug | Status: new

Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"cc0bb07013ed3e7ec58ee6da014ed3094a1a350f" cc0bb07]:
{{{
#!CommitTicketReference repository=""
revision="cc0bb07013ed3e7ec58ee6da014ed3094a1a350f"
Refs #19884 -- Removed DatabaseFeatures.can_introspect_max_length.

Unused (always True) after 3e43d24ad36d45cace57e6a7efd34638577ae744.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/19884#comment:13>

Django

unread,
Jul 13, 2022, 3:08:25 PM7/13/22
to django-...@googlegroups.com
#19884: Inspectdb on Oracle doesn't produce correct field types
-------------------------------------+-------------------------------------
Reporter: Anssi Kääriäinen | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 1.9
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => fixed


Old description:

> 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
>
> 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.

New description:

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.

--

Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/19884#comment:14>

Reply all
Reply to author
Forward
0 new messages