#17202: Inspectdb produces incorrect max_length for NVARCHAR2 columns with 
Oracle
-------------------------------------+-------------------------------------
     Reporter:  rodolfo.3+django@…   |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.3
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:  inspectdb oracle     |      Needs documentation:  0
  max_length                         |  Patch needs improvement:  0
    Has patch:  0                    |                    UI/UX:  0
  Needs tests:  0                    |
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by ikelly):

 * needs_docs:   => 0
 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * stage:  Unreviewed => Accepted


Comment:

 The problem is that the cursor description only includes the size of the
 column in bytes, not in characters.  For a 16-bit encoding, each character
 occupies two bytes.  For another encoding, the ratio may be different.
 The other problem is that we can't distinguish between VARCHAR2 and
 NVARCHAR2 using the cursor description, which would make it impossible to
 correct for the problem by determining the appropriate factor and
 dividing.

 To fix this, we'll need to generalize the column introspection code into
 the backends, and rewrite it for the oracle backend, to have it inspect
 columns by querying the all_tab_cols view instead of just relying on a
 cursor description.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to