Skip to content

[P0][doc-drift] ARCHITECTURE 3.6 promises mysqldump wrapper; implementation is pure-TS with no binary probe #357

Closed

Description

@EVWorth

Context

ARCHITECTURE 3.6 commits to a mysqldump wrapper that detects the binary on PATH plus a fallback custom SQL dump. This is part of the backup/restore feature spec (DESIGN_REQUIREMENTS FR-8 marked [partial]).

Problem

docs/design/ARCHITECTURE.md:572 promises: "Backup — mysqldump wrapper (detects binary on PATH), custom SQL-based dump for environments without mysqldump, schema-only or data-only modes, compression." The implementation has zero mysqldump invocation and zero binary detection. The whole feature is src/lib/backup-generator.ts — pure TypeScript building a SQL string. No which mysqldump, no std::process::Command. Users on servers where the pure-TS generator mangles edge cases (large BLOBs, character-set conversions, partitioned tables, generated columns, spatial types) cannot fall back to the real binary.

Files

  • docs/design/ARCHITECTURE.md:572
  • src/lib/backup-generator.ts:67-79
  • src-tauri/src/commands/mod.rs (no backup_database command)

Repro

  1. Open BackupDialog on a server with very large BLOB columns
  2. Run backup
  3. Observe dump output misses rows / truncates data
  4. No fallback path to mysqldump binary exists

Expected

ARCHITECTURE describes reality. Either implement the mysqldump wrapper or amend the doc.

Proposed fix

M: add #[tauri::command] backup_with_mysqldump in mas-core probing which mysqldump via std::process::Command, falling back to TS path; OR amend ARCHITECTURE 3.6 to drop the mysqldump line and rename "Backup" to "SQL dump (TS generator)".

Acceptance

grep -rn mysqldump src-tauri/ returns >=1 hit in backup_with_mysqldump handler, OR ARCHITECTURE 3.6 is amended to describe the TS-only surface.

Needs human verify

yes (option a needs UX decision; option b is doc-only)

Activity

  1. added
    audit
    severity/p0
    kind/doc-drift
    area/backup
    on Jul 31, 2026
  2. EVWorth commented on Sep 12, 2026

    @EVWorth
    OwnerAuthor

    Rejecting the fix and taking the observation: the doc was wrong, and it is now amended (option b in your own proposal).

    There is no mysqldump wrapper and there should not be one.

    • A desktop user may not have the binary at all, and on Windows usually does not.
    • Where it exists its version has to match the server: mysqldump 8.0 against MariaDB 11 emits syntax the source server does not accept, and an 8.0 server refuses a dump taken by a 5.7 client.
    • It would be a second implementation of the same feature, with its own escaping, its own progress parsing and its own failure modes, chosen by a probe the user cannot see.

    The edge cases you listed as the reason to have it are the right test, so I checked them against the native dump instead — and found the opposite of what the issue assumed. The pure-TS generator was decoding every cell through the grid's value type, which formats DATETIME as %Y-%m-%d %H:%M:%S and rounds through f64. Every backup was silently dropping the fractional seconds from DATETIME(6) and putting BIGINT and DECIMAL through a float. The dump now formats each value from the bytes the server printed over the text protocol — the same bytes mysqldump sees — so:

    • DECIMAL(30,10) keeps its digits
    • BIGINT keeps its last digit
    • DATETIME(6) keeps its microseconds
    • BLOB, VARBINARY, BIT and the spatial types are written as X'..', which needs no escaping in any SQL mode
    • a text column holding bytes that are not valid UTF-8 is written as hex rather than replaced with U+FFFD

    Also fixed along the way: SHOW CREATE VIEW names the view, and every table in its body, with the database it came from, so restoring a dump into a second database recreated the view in the first one.

    ARCHITECTURE 3.6 now reads "Native streaming SQL dump — no external binary", §5.11 describes the commands and the consistency guarantee, and FR-7.3.3 matches. Your acceptance criterion is met by the second branch: the doc describes the TS-free, binary-free surface that exists.

    Done in #652.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/backupauditkind/doc-driftseverity/p0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions