Skip to content

help-tables: fix bootstrap-compat check and unbreak workflow#490

Open
mariadb-ElijahOduba wants to merge 1 commit into
mariadb-corporation:mainfrom
mariadb-ElijahOduba:fix/help-tables-bootstrap-compat
Open

help-tables: fix bootstrap-compat check and unbreak workflow#490
mariadb-ElijahOduba wants to merge 1 commit into
mariadb-corporation:mainfrom
mariadb-ElijahOduba:fix/help-tables-bootstrap-compat

Conversation

@mariadb-ElijahOduba
Copy link
Copy Markdown
Contributor

@mariadb-ElijahOduba mariadb-ElijahOduba commented May 14, 2026

Pull Request

Unbreaks the Generate Help Tables SQL workflow (broken on main since #484 merged) and makes the generator output mariadbd --bootstrap-compatible so @grooverdan can unblock MDEV-39584 / MariaDB/server#5068.

Type of Change

  • Bug fix

Description

Three layered fixes:

  1. Workflow YAML: the Check server compatibility step Daniel added in github workflow: generate-help-tables - check server #484 has backslash-line-continued bash -c '...' inside run: | that GitHub's parser rejects with line 50 syntax error (passes actionlint and PyYAML, fails the real thing). Rewritten as a clean sh -c '...' block. This is why every push to main since 2026-05-13 has been a 0-second CI failure.
  2. truncate_to_bytes sized for help_topic.description (TEXT, 65 KB) but sql_bootstrap.h caps each query at MAX_BOOTSTRAP_QUERY_SIZE = 20,000 bytes. Dropped the cap to 15,000 raw bytes so the escaped INSERT plus boilerplate fits.
  3. escape_sql keeps \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.py rewritten 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

@mariadb-ElijahOduba mariadb-ElijahOduba marked this pull request as ready for review May 14, 2026 15:29
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'.
@mariadb-ElijahOduba mariadb-ElijahOduba force-pushed the fix/help-tables-bootstrap-compat branch from 91a4241 to fdc3c59 Compare May 14, 2026 15:35
@grooverdan
Copy link
Copy Markdown
Contributor

❤️ , thank you.
workflow - https://github.com/mariadb-ElijahOduba/mariadb-docs/actions/runs/25869262171
I've tested the generated artifact in the the server and it functions on bootstrap.

grooverdan

This comment was marked as off-topic.

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.

2 participants