Skip to main content

Module cli

Module cli 

Source
Expand description

CLI subcommand implementations for the inno binary.

The inno binary provides eleven subcommands for analyzing InnoDB data files, redo logs, and system tablespaces. CLI argument parsing uses clap derive macros, with the top-level app::Cli struct and app::Commands enum defined in app and shared between main.rs and build.rs (for man page generation) via include!().

Each subcommand module follows the same pattern: an Options struct holding the parsed arguments and a pub fn execute(opts, writer) -> Result<(), IdbError> entry point. The writer: &mut dyn Write parameter allows output to be captured in tests or redirected to a file via the global --output flag.

§Subcommands

CommandModulePurpose
inno parseparseParse FIL headers for every page and show a page-type summary table
inno pagespagesDeep structure analysis of INDEX, UNDO, BLOB/LOB, and SDI pages
inno dumpdumpHex dump of raw bytes by page number or absolute file offset
inno checksumchecksumValidate CRC-32C and legacy InnoDB checksums for every page
inno corruptcorruptInject random bytes into a page for testing recovery workflows
inno recoverrecoverAssess page-level recoverability and count salvageable records
inno findfindSearch a MySQL data directory for pages matching a page number
inno tsidtsidList or look up tablespace (space) IDs across .ibd/.ibu files
inno sdisdiExtract SDI metadata (MySQL 8.0+ serialized data dictionary)
inno loglogAnalyze redo log file headers, checkpoints, and data blocks
inno infoinfoInspect ibdata1, compare LSNs, or query a live MySQL instance

§Common patterns

  • --json — Every subcommand supports structured JSON output via #[derive(Serialize)] structs and serde_json.
  • --page-size — Override auto-detected page size (useful for non-standard 4K, 8K, 32K, or 64K tablespaces).
  • --verbose / -v — Show additional detail such as per-page checksum status, FSEG internals, or MLOG record types.
  • --color (global) — Control colored terminal output (auto, always, never).
  • --output / -o (global) — Redirect output to a file instead of stdout.

Progress bars (via indicatif) are displayed for long-running operations in parse, checksum, and find. The wprintln! and wprint! macros wrap writeln!/write! to convert io::Error into IdbError.

Modules§

app
checksum
corrupt
dump
find
info
log
pages
parse
recover
sdi
tsid