Skip to content

[P0][bug] EXPLAIN ANALYZE MariaDB tabular output joined with newlines produces unreadable text #422

Closed

Description

@EVWorth

Context

EXPLAIN ANALYZE in MariaDB returns a different shape (tabular instead of TREE text).

Problem

MariaDB's ANALYZE (without EXPLAIN prefix) returns tabular output with columns like id, select_type, table, type, … — same shape as EXPLAIN. ExplainPanel.tsx:411-460 (AnalyzeView) does result.rows.map((row) => row.map((v) => String(v ?? "")).join("\n")).join("\n") — joins all columns with newlines, producing "1\nSIMPLE\nusers\nALL\n..." instead of structured table. resultStore.ts:125 sets explainAnalyze: true for MariaDB via ANALYZE ${sql}, and AnalyzeView renders it as text. The user sees a stream of single words per line instead of the tabular form they're used to. Compare to MySQL's EXPLAIN ANALYZE FORMAT=TREE which returns a single-column text per row — that's the expected case.

Files

  • src/components/explain/ExplainPanel.tsx:411-460 (AnalyzeView)
  • src/stores/resultStore.ts:125 (MariaDB detection)

Repro

  1. Connect to MariaDB
  2. ANALYZE SELECT * FROM users LIMIT 1
  3. EXPLAIN panel shows wall of single-word-per-line text

Expected

MariaDB ANALYZE on SELECT * FROM users LIMIT 1 shows the same tabular ExplainTable view as MySQL EXPLAIN. MySQL EXPLAIN ANALYZE FORMAT=TREE shows the existing AnalyzeView text.

Proposed fix

Detect MariaDB tabular output heuristically: if result.columns.length > 4, render with ExplainTable instead of AnalyzeView. Or strip leading -> tokens and present as a tree. Cleanest: detect via the column count (TREE format returns 1 column; tabular returns 12+). Scope: M.

Acceptance

MariaDB ANALYZE on SELECT * FROM users LIMIT 1 shows the same tabular ExplainTable view as MySQL EXPLAIN. MySQL EXPLAIN ANALYZE FORMAT=TREE shows the existing AnalyzeView text.

Needs human verify

yes

Doc drift

no

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/explainauditkind/bugseverity/p0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions