ci: pin EXPLAIN to FORMAT=TRADITIONAL for MySQL 9.5+ - #4493
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Problem
test/integration/connection/test-execute-nocolumndef.test.mtsfails against MySQL ≥ 9.5 (currentmysql:9/mysql:ltsimages), while passing on 5.7–9.0 and MariaDB.Root cause
MySQL 9.5.0 changed the default of the
explain_formatsystem variable fromTRADITIONALtoTREE(same change that hit rails/rails#55958). A bareEXPLAIN SELECT 1now returns a singleEXPLAINcolumn whose text embeds optimizer cost numbers: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.0job predates the default flip, which is why CI stayed green.Fix
Pin the statement to
explain format=traditional SELECT 1on MySQL so the assertions stay deterministic.FORMAT=TRADITIONALis accepted since MySQL 5.6 and emits no deprecation warning on 9.7.MariaDB keeps the bare
explain: it has noexplain_formatvariable, its tabular default is unchanged, and its expectations were already branched viaisMariaDB(I only verifiedFORMAT=TRADITIONALsupport 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_PREPAREreturns 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 typecheckandnpm run lintclean:explain_format=TREEdefault)