Fix missing CSV header for empty data directory in inno audit - #213
Merged
Conversation
audit's empty-directory branch handled --prometheus and --json per mode but had no --csv arm, so `inno audit --compliance --csv` (and every other mode with --format csv) printed the plain-text "No .ibd files found" message on an empty datadir instead of a valid CSV header. This corrupts downstream parsers. Add an else-if opts.csv arm that emits the same header the non-empty path uses for each mode (compliance, health with/without bloat, checksum-mismatch, default integrity), with no rows. Add a regression test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
inno audit's empty-directory branch handled--prometheusand--json(with per-mode output) but had no--csvarm. Soinno audit --compliance --csv- and every other mode under--format csv- printed the plain-textNo .ibd files foundmessage on an empty datadir instead of a valid CSV header, corrupting any downstream parser.This is the same class of gap PR #118 fixed once for
--prometheus. It was surfaced during review of #211 and deferred because it lived in the shared empty-files block rather than the compliance lines that PR added.Fix
Add an
else if opts.csvarm that emits the same header the non-empty path uses for each mode (header only, no rows):file,match_count,pages_with_matches,capped,error--bloat): the bloat-aware headerfile,page_number,stored_checksum,calculated_checksum,algorithmfile,status,total_pages,empty_pages,valid_pages,invalid_pages,lsn_mismatchesPlain-text output (no
--csv) is unchanged.Testing
test_audit_empty_directory_csv_emits_headercovers compliance and default modes; mutation-checked (fails without the fix, passes with it).