Skip to content

Database Version reports the MySQL/MariaDB client, not the database server #318

Description

@JoshuaGoode

Describe the bug
Host Test Results has a field labeled "Database Version". Right now, the runner
fills mysql_version with output from mysql --version.

That command tells us which MySQL/MariaDB client binary is installed where the
runner runs. It does not tell us which database server WordPress used for the
test.

That makes the field misleading and a client version is not really useful.

"Database Version" reads as, and should be, the server version. When we are
comparing MySQL/MariaDB results or trying to understand a failure, we'll want the specific server version.

To Reproduce
Review recent tests or perform a new test and examine env.json.

Today it can contain a client binary string, for example:

mysql Ver 15.1 Distrib 10.4.12-MariaDB, for debian-linux-gnu ...

Expected behavior
When the runner can connect to the configured test database safely,
mysql_version should contain the raw server version string, such as the value
returned by SELECT VERSION().

If the runner cannot detect the server version safely, it should leave the value
empty or absent so the current reporter displays Unknown. I would rather have
Unknown than a value we know points to the wrong thing.

It should not fall back to the client binary version.

Additional context

There is some history here:

I think the first PR should stay small:

  • Preserve the existing mysql_version env key for reporter compatibility.
  • Keep the change runner-only.
  • Store the raw server version string when detection succeeds.
  • Use empty/unknown behavior when detection fails.
  • Guard missing credentials, missing mysqli, connection failure, query
    failure, empty result rows, and PHP 8.1+ mysqli exception behavior.
  • Do not add a client-version field in the first PR.
  • Do not change reporter display, taxonomy behavior...etc.

Activity

  1. JoshuaGoode commented on Jun 4, 2026

    @JoshuaGoode
    ContributorAuthor

    I've opened #319 for this but wanted an issue in place first as this has been an ongoing problem tied to multiple past tickets and PRs.

  2. JoshuaGoode commented on Jun 4, 2026

    @JoshuaGoode
    ContributorAuthor

    Using my changes from #319 on a test runner site, here's an example of the Database Version being properly reported as the server version: https://make.wordpress.org/hosting/test-results/r62456/wpcombot-r62456-8-5-11-4-8-mariadb-log/

    That report shows Database Version as 11.4.8-MariaDB-log, matching the server
    version returned by the live database rather than a mysql Ver ... client string.

    Compare that to the client versions seen across the other reporters.
    https://make.wordpress.org/hosting/test-results/r62456/

  3. JoshuaGoode commented on Jun 5, 2026

    @JoshuaGoode
    ContributorAuthor

    Noting that I have worked with two hosts to use my branch, #319, and they are actively reporting the database server version now.

    May need testing in other setups but works in these live production envs.

    https://make.wordpress.org/hosting/test-results/r62462/pressablebot-r62462-8-5-11-4-8-mariadb-log/

    https://make.wordpress.org/hosting/test-results/r62462/wpcombot-r62462-8-4-11-4-8-mariadb-log/

  4. moved this from In progress to In review in Hosting Team WCUS 2026on Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions