help-tables: fix bootstrap-compat check and unbreak workflow#490
Open
mariadb-ElijahOduba wants to merge 1 commit into
Open
Conversation
The "Check server compatibility" step Daniel added in mariadb-corporation#484 had three problems preventing it from being useful: 1. The workflow YAML itself was rejected by GitHub's parser (backslash- line-continued bash -c '...' inside `run: |` produced a "line 50 syntax error" even though actionlint and PyYAML accept it). Rewrite the step as a clean multi-line `sh -c '...'` block. 2. truncate_to_bytes was sized for help_topic.description (TEXT, 65 KB), but sql_bootstrap.h caps each query at MAX_BOOTSTRAP_QUERY_SIZE = 20,000 bytes. Drop the cap to 15,000 raw bytes so the escaped INSERT plus boilerplate fits comfortably. 3. The bootstrap parser is line-naive — it skips blank lines and lines starting with `--`/`#`, and treats any line ending in `;` as a statement terminator, without tracking string-literal state. Keep the `\n -> \\n` substitution in escape_sql so every INSERT stays on one line; update the comment to say why. validate_sql.py rewritten to parse statements (split on `;` outside strings, skip `--` comments) instead of lines, and to enforce the 20K-per-INSERT bootstrap limit explicitly. Verified locally with the same Docker bootstrap step CI runs; populated server returns full content for HELP 'SELECT', HELP 'COUNT', HELP 'GROUP BY'.
91a4241 to
fdc3c59
Compare
Contributor
|
❤️ , thank you. |
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.
Pull Request
Unbreaks the
Generate Help Tables SQLworkflow (broken onmainsince #484 merged) and makes the generator outputmariadbd --bootstrap-compatible so @grooverdan can unblock MDEV-39584 / MariaDB/server#5068.Type of Change
Description
Three layered fixes:
Check server compatibilitystep Daniel added in github workflow: generate-help-tables - check server #484 has backslash-line-continuedbash -c '...'insiderun: |that GitHub's parser rejects withline 50 syntax error(passesactionlintand PyYAML, fails the real thing). Rewritten as a cleansh -c '...'block. This is why every push tomainsince 2026-05-13 has been a 0-second CI failure.truncate_to_bytessized forhelp_topic.description(TEXT, 65 KB) butsql_bootstrap.hcaps each query atMAX_BOOTSTRAP_QUERY_SIZE= 20,000 bytes. Dropped the cap to 15,000 raw bytes so the escaped INSERT plus boilerplate fits.escape_sqlkeeps\n -> \\n; comment updated to explain why (bootstrap parser is line-naive; it skips blank/--/#lines and treats any line ending in;as a statement terminator, without tracking string-literal state, so real newlines inside string literals would corrupt INSERTs).validate_sql.pyrewritten to parse statements (split on;outside strings) instead of lines, and to enforce the 20K-per-INSERT limit explicitly so this regression can't recur silently.Verified end-to-end against the same Docker bootstrap step CI runs, plus a populated server returning correct
HELP 'SELECT' / 'COUNT' / 'GROUP BY'. Fork CI green: https://github.com/mariadb-ElijahOduba/mariadb-docs/actions/runs/25868580315