Opened 14 years ago

Closed 9 years ago

#14098 closed New feature (fixed)

Prevent introspection errors from crashing inspectdb

Reported by: Adam Vandenberg Owned by: nobody
Component: Core (Management commands) Version: dev
Severity: Normal Keywords: inspectdb
Cc: anubhav9042@… 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

If you're inspecting a MySQL db, and it has a view that references missing columns, then inspectdb will stop with an exception while inspecting that database.

Add a "--skip" option to inspectdb to skip over tables that throw errors instead of aborting.

Attachments (3)

inspect-skip.diff (9.5 KB ) - added by Adam Vandenberg 14 years ago.
skip.diff (9.5 KB ) - added by Adam Vandenberg 14 years ago.
Updated patch.
14098-3.diff (1.5 KB ) - added by Claude Paroz 11 years ago.
Output errors

Download all attachments as: .zip

Change History (16)

by Adam Vandenberg, 14 years ago

Attachment: inspect-skip.diff added

comment:1 by Anssi Kääriäinen, 14 years ago

The first impression I get from --skip is that you can list tables you don't want to inspect. Better name could be something like --ignore-errors?

Another solution would be to provide --skip-tables and --only-tables, so that one could manually skip the error producing tables.

by Adam Vandenberg, 14 years ago

Attachment: skip.diff added

Updated patch.

comment:2 by Gabriel Hurley, 14 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Gabriel Hurley, 14 years ago

Component: django-admin.py inspectdbCore (Management commands)

comment:4 by patchhammer, 14 years ago

Easy pickings: unset
Patch needs improvement: set
Severity: Normal
Type: Uncategorized

skip.diff fails to apply cleanly on to trunk

comment:5 by Adam Vandenberg, 14 years ago

If there is still interest in accepting this, I can rework the patch; otherwise a maintainer ought to close it.

comment:6 by Julien Phalip, 14 years ago

Type: UncategorizedNew feature

comment:7 by Ramiro Morales, 13 years ago

Keywords: inspectdb added
UI/UX: unset

by Claude Paroz, 11 years ago

Attachment: 14098-3.diff added

Output errors

comment:8 by Claude Paroz, 11 years ago

Needs tests: set
Patch needs improvement: unset
Version: 1.2master

The attached patch, instead of adding a new command parameter, just output in the result that some table was not introspected. For example:

# Unable to inspect table v_test
# The error was: View 'test_.v_test' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them

comment:9 by ANUBHAV JOSHI, 11 years ago

Cc: anubhav9042@… added

comment:10 by Claude Paroz, 9 years ago

Needs tests: unset

comment:11 by Tim Graham, 9 years ago

Summary: Add "--skip" option to inspectdb.Prevent introspection errors from crashing inspectdb

comment:12 by Tim Graham, 9 years ago

Triage Stage: AcceptedReady for checkin

comment:13 by Claude Paroz <claude@…>, 9 years ago

Resolution: fixed
Status: newclosed

In 4c18a8a3:

Fixed #14098 -- Prevented crash for introspection errors in inspectdb

Thanks Tim Graham for the review.

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