Opened 8 years ago

Last modified 8 years ago

#27977 closed Bug

inspectdb errors after upgrade to Oracle 12.1 — at Initial Version

Reported by: JorisBenschop Owned by: nobody
Component: Database layer (models, ORM) Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi

After upgrading Oracle from 11.2 to 12.1, {{manage.py inspectdb}} returns errors

# Unable to inspect table 'test_table'
# The error was: unorderable types: NoneType() > int()

My original install was 1.9, but upgrading to Django 1.10 gave the same error. Oddly, the error in 1.9 came with a complete stack trace, while the one in 1.10 only have the above error. Here's the stack from 1.9

from django.db import models
DEBUG (0.004) QUERY = "SELECT TABLE_NAME, 't' FROM USER_TABLES UNION ALL SELECT VIEW_NAME, 'v' FROM USER_VIEWS" - PARAMS = (); args=None


class AuthGroup(models.Model):
DEBUG (14.986) QUERY = '\n    SELECT ta.column_name, tb.table_name, tb.column_name\n    FROM   user_constraints, USER_CONS_COLUMNS ca, USER_CONS_COLUMNS cb,\n           user_tab_cols ta, user_tab_cols tb\n    WHERE  user_constraints.table_name = :arg0 AND\n           ta.table_name = user_constraints.table_name AND\n           ta.column_name = ca.column_name AND\n           ca.table_name = ta.table_name AND\n           user_constraints.constraint_name = ca.constraint_name AND\n           user_constraints.r_constraint_name = cb.constraint_name AND\n           cb.table_name = tb.table_name AND\n           cb.column_name = tb.column_name AND\n           ca.position = cb.position' - PARAMS = ('AUTH_GROUP',); args=['AUTH_GROUP']
DEBUG (8.362) QUERY = "\n    SELECT LOWER(uic1.column_name) AS column_name,\n           CASE user_constraints.constraint_type\n               WHEN 'P' THEN 1 ELSE 0\n           END AS is_primary_key,\n           CASE user_indexes.uniqueness\n               WHEN 'UNIQUE' THEN 1 ELSE 0\n           END AS is_unique\n    FROM   user_constraints, user_indexes, user_ind_columns uic1\n    WHERE  user_constraints.constraint_type (+) = 'P'\n      AND  user_constraints.index_name (+) = uic1.index_name\n      AND  user_indexes.uniqueness (+) = 'UNIQUE'\n      AND  user_indexes.index_name (+) = uic1.index_name\n      AND  uic1.table_name = UPPER(:arg0)\n      AND  uic1.column_position = 1\n      AND  NOT EXISTS (\n              SELECT 1\n              FROM   user_ind_columns uic2\n              WHERE  uic2.index_name = uic1.index_name\n                AND  uic2.column_position = 2\n           )\n        " - PARAMS = ('auth_group',); args=['auth_group']
Traceback (most recent call last):
  File "./manage.py", line 16, in <module>
    execute_from_command_line(sys.argv)
  File "/tools/general/app/anaconda-python-3.4/lib/python3.4/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
    utility.execute()
  File "/tools/general/app/anaconda-python-3.4/lib/python3.4/site-packages/django/core/management/__init__.py", line 342, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/tools/general/app/anaconda-python-3.4/lib/python3.4/site-packages/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/tools/general/app/anaconda-python-3.4/lib/python3.4/site-packages/django/core/management/base.py", line 399, in execute
    output = self.handle(*args, **options)
  File "/tools/general/app/anaconda-python-3.4/lib/python3.4/site-packages/django/core/management/commands/inspectdb.py", line 25, in handle
    for line in self.handle_inspection(options):
  File "/tools/general/app/anaconda-python-3.4/lib/python3.4/site-packages/django/core/management/commands/inspectdb.py", line 66, in handle_inspection
    indexes = connection.introspection.get_indexes(cursor, table_name)
  File "/tools/general/app/anaconda-python-3.4/lib/python3.4/site-packages/django/db/backends/oracle/introspection.py", line 144, in get_indexes
    for row in cursor.fetchall():
  File "/tools/general/app/anaconda-python-3.4/lib/python3.4/site-packages/django/db/utils.py", line 102, in inner
    return func(*args, **kwargs)
  File "/tools/general/app/anaconda-python-3.4/lib/python3.4/site-packages/django/db/backends/oracle/base.py", line 519, in fetchall
    return tuple(_rowfactory(r, self.cursor) for r in self.cursor.fetchall())
  File "/tools/general/app/anaconda-python-3.4/lib/python3.4/site-packages/django/db/backends/oracle/base.py", line 519, in <genexpr>
    return tuple(_rowfactory(r, self.cursor) for r in self.cursor.fetchall())
  File "/tools/general/app/anaconda-python-3.4/lib/python3.4/site-packages/django/db/backends/oracle/base.py", line 580, in _rowfactory
    elif precision > 0:
TypeError: unorderable types: NoneType() > int()

The default database only contains tables that django itself has made and that were not touched by any user directly.

Change History (0)

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