Skip to content

Run MySQL server result tests against the SQLite proxy#438

Open
adamziel wants to merge 9 commits into
WordPress:trunkfrom
adamziel:codex/mysql-result-suite-ci
Open

Run MySQL server result tests against the SQLite proxy#438
adamziel wants to merge 9 commits into
WordPress:trunkfrom
adamziel:codex/mysql-result-suite-ci

Conversation

@adamziel

@adamziel adamziel commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

This replaces the parser-only direction from the reverted PR with a result-suite workflow that actually executes MySQL server test cases and compares their expected output.

The new workflow downloads Oracle MySQL's 8.0.46 test-suite archive, starts this repository's PHP MySQL proxy backed by the SQLite driver, and runs MySQL's mysql-test-run.pl in --extern mode against that proxy. That means the CI signal comes from .test files and .result files, not from the existing mysql-server-tests-queries.csv lexer/parser corpus.

What Runs

  • Adds .github/workflows/mysql-server-result-suite.yml.
  • Runs on every PR, on trunk pushes, and by manual dispatch.
  • Installs only the lightweight command-line client package with a 5-minute timeout; it no longer installs the large mariadb-test package that hung in CI.
  • Downloads the MySQL test-suite tarball directly from cdn.mysql.com and discovers Oracle's mysqltest plus mysql-test-run.pl from that archive.
  • Builds a temporary client bindir containing Oracle mysqltest and the packaged mysql/mysqladmin clients for MTR.
  • Starts packages/mysql-proxy/bin/wp-mysql-proxy.php on localhost.
  • Runs mysql-test-run.pl --extern ... --force --parallel=1 so the suite keeps collecting result mismatches instead of stopping after the first failure.

Proxy Setup

MySQL's test framework expects the default database to be named test when running test cases, and its startup probe also connects to the mysql schema to read server variables. The proxy previously hard-coded its exposed schema name as sqlite_database, so this PR adds:

  • --database-name, used in CI as --database-name test.
  • --database-alias, used in CI as --database-alias mysql so MTR's startup probe can connect.

The existing default remains sqlite_database for current users and tests.

Known Limitations

  • This will be much heavier than the old parser/lexer workflow; the timeout is set to 6 hours.
  • The job runs the upstream MySQL result suite against the current SQLite-backed proxy, so existing emulation gaps are expected to appear as real failures.
  • The MySQL test-suite archive is large, so the download step has a hard timeout and retries instead of relying on an unbounded apt package install.
  • The proxy still supports a single logical database. The mysql alias is only an alias for MTR compatibility; it does not add real multi-database support.

Validation

  • Parsed .github/workflows/mysql-server-result-suite.yml as YAML.
  • Ran bash -n over every workflow run: block in the new file.
  • Ran php -l on the changed proxy PHP files.
  • Ran PHPCS on the changed proxy PHP files.
  • Ran git diff --check on the workflow and proxy changes.
  • Smoke-tested the new proxy database-name path through the adapter: USE test, SELECT DATABASE(), and SELECT 1 AS result.
  • Smoke-tested the new proxy alias path through the adapter: USE mysql and USE \mysql``.

@adamziel adamziel force-pushed the codex/mysql-result-suite-ci branch 5 times, most recently from 95610e1 to 6234a00 Compare June 17, 2026 15:52
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