#27977: inspectdb errors after upgrade to Oracle 12.1
-------------------------------------+-------------------------------------
     Reporter:  JorisBenschop        |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.10
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by JorisBenschop):

 {{{
     SELECT LOWER(uic1.column_name) AS column_name,
            CASE user_constraints.constraint_type
                WHEN 'P' THEN 1 ELSE 0
            END AS is_primary_key,
            CASE user_indexes.uniqueness
                WHEN 'UNIQUE' THEN 1 ELSE 0
            END AS is_unique
     FROM   user_constraints, user_indexes, user_ind_columns uic1
     WHERE  user_constraints.constraint_type (+) = 'P'
       AND  user_constraints.index_name (+) = uic1.index_name
       AND  user_indexes.uniqueness (+) = 'UNIQUE'
       AND  user_indexes.index_name (+) = uic1.index_name
       AND  uic1.table_name = UPPER(:arg0)
       AND  uic1.column_position = 1
       AND  NOT EXISTS (
               SELECT 1
               FROM   user_ind_columns uic2
               WHERE  uic2.index_name = uic1.index_name
                 AND  uic2.column_position = 2
            )
 }}}
 cursor.bindvars
 [<cx_Oracle.STRING with value 'auth_group'>]

 cursor.description
 [('COLUMN_NAME', <class 'cx_Oracle.STRING'>, 4000, 12000, None, None, 1),
 ('IS_PRIMARY_KEY', <class 'cx_Oracle.NUMBER'>, 127, None, None, None, 1),
 ('IS_UNIQUE', <class 'cx_Oracle.NUMBER'>, 127, None, None, None, 1)]

 then in backends/oracle/base/_rowfactory the second item  is processed
 ('IS_PRIMARY_KEY', <class 'cx_Oracle.NUMBER'>, 127, None, None, None, 1)
 {{{
 precision, scale = desc[4:6]
 ...
 elif precision > 0
 }}}
 But the cursor.description coming from Oracle say that precision and scale
 are None, so we crash.

 for completeness:
 {{{
 import cx_Oracle
 cx_Oracle.__version__
 '5.3'
 }}}

 hope this helps

--
Ticket URL: <https://code.djangoproject.com/ticket/27977#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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.c8e307908d85127dfba58688aa53ff7a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to