Skip to content

ci: pin EXPLAIN to FORMAT=TRADITIONAL for MySQL 9.5+ - #4493

Merged
sidorares merged 1 commit into
masterfrom
claude/brave-merkle-b3daf3
Aug 23, 2026
Merged

ci: pin EXPLAIN to FORMAT=TRADITIONAL for MySQL 9.5+#4493
sidorares merged 1 commit into
masterfrom
claude/brave-merkle-b3daf3

Conversation

@sidorares

Copy link
Copy Markdown
Owner

Problem

test/integration/connection/test-execute-nocolumndef.test.mts fails against MySQL ≥ 9.5 (current mysql:9 / mysql:lts images), while passing on 5.7–9.0 and MariaDB.

Root cause

MySQL 9.5.0 changed the default of the explain_format system variable from TRADITIONAL to TREE (same change that hit rails/rails#55958). A bare EXPLAIN SELECT 1 now returns a single EXPLAIN column whose text embeds optimizer cost numbers:

-> Rows fetched before execution  (cost=0..0 rows=1)

The driver parses this resultset fine — only the test's hard-coded rows/fields expectations assume the traditional 12-column table. CI's mysql:9.0 job predates the default flip, which is why CI stayed green.

Fix

Pin the statement to explain format=traditional SELECT 1 on MySQL so the assertions stay deterministic. FORMAT=TRADITIONAL is accepted since MySQL 5.6 and emits no deprecation warning on 9.7.

MariaDB keeps the bare explain: it has no explain_format variable, its tabular default is unchanged, and its expectations were already branched via isMariaDB (I only verified FORMAT=TRADITIONAL support on MariaDB 12.3, not CI's 11.8, so the MariaDB path is deliberately untouched).

The test's actual purpose — the binary-protocol path from #130 / #37 where COM_STMT_PREPARE returns zero column definitions and fields only arrive at execute — is preserved: verified that prepare still returns 0 columns for the pinned statement on 8.3 and 9.7.

Verification

Test passes against all four local servers, npm run typecheck and npm run lint clean:

Server Result
MySQL 5.7.44
MySQL 8.3.0
MySQL 9.7.2 (explain_format=TREE default)
MariaDB 12.3.2

MySQL 9.5.0 changed the default explain_format from TRADITIONAL to TREE,
whose single-column output embeds nondeterministic optimizer costs. Pin
the tabular format so the exact-match assertions keep holding; MariaDB
has no explain_format and stays on the bare statement.
@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.45%. Comparing base (c86fe5a) to head (29310ca).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4493   +/-   ##
=======================================
  Coverage   92.45%   92.45%           
=======================================
  Files          93       93           
  Lines       15855    15855           
  Branches     2254     2254           
=======================================
  Hits        14658    14658           
  Misses       1197     1197           
Flag Coverage Δ
compression-0 92.06% <ø> (ø)
compression-1 92.43% <ø> (ø)
static-parser-0 91.26% <ø> (ø)
static-parser-1 91.37% <ø> (ø)
tls-0 92.01% <ø> (ø)
tls-1 92.45% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sidorares
sidorares merged commit 493f9ec into master Aug 23, 2026
103 checks passed
@sidorares
sidorares deleted the claude/brave-merkle-b3daf3 branch August 23, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant