Skip to content

Tests: Fix database charset tests on MariaDB 13.1 - #13497

Open
MicahelE wants to merge 2 commits into
WordPress:trunkfrom
MicahelE:66072-mariadb-utf8
Open

Tests: Fix database charset tests on MariaDB 13.1#13497
MicahelE wants to merge 2 commits into
WordPress:trunkfrom
MicahelE:66072-mariadb-utf8

Conversation

@MicahelE

@MicahelE MicahelE commented Sep 11, 2026

Copy link
Copy Markdown

On MariaDB 13.1, four database tests fail. MariaDB changed what the utf8 character set name means. It used to mean the older 3-byte version (utf8mb3), and now it means utf8mb4.

WordPress itself isn't affected. Only the tests are, because they used utf8 and expected the old meaning.

This PR updates the tests so they say exactly which character set they mean:

  • Two test tables now use utf8mb3 instead of utf8.
  • The collation test now uses utf8mb4_general_ci, which gives the same result on every server.

Testing

I tested on MariaDB 13.1.1 using MariaDB's development image (quay.io/mariadb-foundation/mariadb-devel:13.1), because 13.1 isn't on Docker Hub yet.

Server trunk This PR
MariaDB 13.1.1 4 failures, the ones in the ticket All 100 pass
MariaDB 11.4 with --old-mode= (same change as 13.1) 4 failures All 100 pass
MariaDB 11.4, default settings Not run All 100 pass
MySQL 8.4 Not run All 100 pass

To run them: vendor/bin/phpunit tests/phpunit/tests/db/charset.php

Trac ticket: https://core.trac.wordpress.org/ticket/66072

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: Finding the cause, writing the test changes, and running the tests on each server. I reviewed the changes and take responsibility for them.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

MariaDB 13.1 removes `UTF8_IS_UTF8MB3` from the default `old_mode`, so the `utf8`
alias now creates `utf8mb4` instead of `utf8mb3`. Four tests in `Tests_DB_Charset`
relied on the alias meaning 3-byte UTF-8.

Declare `utf8mb3` explicitly in the affected data sets, and use `utf8mb4` in the
`set_charset()` collation test, so the expectations no longer depend on the server.

Fixes #66072.
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props micahele.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

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