Opened 4 years ago
Closed 4 years ago
#33643 closed Bug (fixed)
inspectdb crashes on Oracle databases with functional indexes.
| Reported by: | Scott | Owned by: | Scott |
|---|---|---|---|
| Component: | Core (Management commands) | Version: | 4.0 |
| Severity: | Normal | Keywords: | oracle inspectdb |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I'm getting the following error when using inspectdb with an Oracle database. The column in question is a hidden column that's automatically created by the database, and doesn't need a model. The command runs fine if I add something to skip these columns. Here's a related issue in SQLAlchemy: https://github.com/sqlalchemy/sqlalchemy/issues/1513
Traceback (most recent call last):
File "xxxx\envs\django\Scripts\manage.py-script.py", line 33, in <module>
sys.exit(load_entry_point('hero', 'console_scripts', 'manage.py')())
File "xxxx\__init__.py", line 17, in manage
execute_from_command_line(sys.argv)
File "xxxx\envs\django\lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line utility.execute()
File "xxxx\envs\django\lib\site-packages\django\core\management\__init__.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "xxxx\envs\django\lib\site-packages\django\core\management\base.py", line 414, in run_from_argv
self.execute(*args, **cmd_options)
File "xxxx\envs\django\lib\site-packages\django\core\management\base.py", line 460, in execute
output = self.handle(*args, **options)
File "xxxx\envs\django\lib\site-packages\django\core\management\commands\inspectdb.py", line 46, in handle
for line in self.handle_inspection(options):
File "xxxx\envs\django\lib\site-packages\django\core\management\commands\inspectdb.py", line 226, in handle_inspection
yield from self.get_meta(
File "xxxx\envs\django\lib\site-packages\django\core\management\commands\inspectdb.py", line 348, in get_meta
str(tuple(column_to_field_name[c] for c in columns))
File "xxxx\envs\django\lib\site-packages\django\core\management\commands\inspectdb.py", line 348, in <genexpr>
str(tuple(column_to_field_name[c] for c in columns))
KeyError: 'sys_nc00106$'
Change History (8)
follow-up: 2 comment:1 by , 4 years ago
| Keywords: | oracle inspectdb added |
|---|---|
| Summary: | KeyError when running manage.py inspectdb against an Oracle database. → inspectdb crashes on Oracle databases with functional indexes. |
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 4 years ago
Replying to Mariusz Felisiak:
I'm aware there are hidden/internal columns on Oracle, so it seems valid. Would you like to provide a patch?
I can make a patch.
comment:3 by , 4 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:5 by , 4 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
comment:6 by , 4 years ago
| Patch needs improvement: | set |
|---|---|
| Triage Stage: | Ready for checkin → Accepted |
comment:7 by , 4 years ago
| Patch needs improvement: | unset |
|---|---|
| Triage Stage: | Accepted → Ready for checkin |
I'm aware there are hidden/internal columns on Oracle, so it seems valid. Would you like to provide a patch?