Opened 6 years ago

Closed 7 months ago

#14098 closed New feature (fixed)

Prevent introspection errors from crashing inspectdb

Reported by: Adam Vandenberg Owned by: nobody
Component: Core (Management commands) Version: master
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 6 years ago.
skip.diff (9.5 KB) - added by Adam Vandenberg 6 years ago.
Updated patch.
14098-3.diff (1.5 KB) - added by Claude Paroz 3 years ago.
Output errors

Download all attachments as: .zip

Change History (16)

Changed 6 years ago by Adam Vandenberg

Attachment: inspect-skip.diff added

comment:1 Changed 6 years ago by Anssi Kääriäinen

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

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.

Changed 6 years ago by Adam Vandenberg

Attachment: skip.diff added

Updated patch.

comment:2 Changed 6 years ago by Gabriel Hurley

Triage Stage: UnreviewedAccepted

comment:3 Changed 6 years ago by Gabriel Hurley

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

comment:4 Changed 5 years ago by patchhammer

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

skip.diff fails to apply cleanly on to trunk

comment:5 Changed 5 years ago by Adam Vandenberg

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

comment:6 Changed 5 years ago by Julien Phalip

Type: UncategorizedNew feature

comment:7 Changed 5 years ago by Ramiro Morales

Keywords: inspectdb added
UI/UX: unset

Changed 3 years ago by Claude Paroz

Attachment: 14098-3.diff added

Output errors

comment:8 Changed 3 years ago by Claude Paroz

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 Changed 2 years ago by ANUBHAV JOSHI

Cc: anubhav9042@… added

comment:10 Changed 7 months ago by Claude Paroz

Needs tests: unset

comment:11 Changed 7 months ago by Tim Graham

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

comment:12 Changed 7 months ago by Tim Graham

Triage Stage: AcceptedReady for checkin

comment:13 Changed 7 months ago by Claude Paroz <claude@…>

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