Repository navigation
Conversation
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.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the charset-test updates and Windows setup guidance.
No open issues 🎉
What changed in this PR
This PR makes database charset tests independent of the changed utf8 alias in MariaDB 13.1, without changing WordPress runtime behavior. It also adds Windows development setup guidance.
Changes:
- Uses explicit
utf8mb3character sets in two test table definitions. - Uses
utf8mb4_general_cifor the connection collation assertion and adds ticket references. - Documents recommended WSL setup and Docker’s Linux-container mode on Windows.
| File | Description |
|---|---|
| tests/phpunit/tests/db/charset.php | Makes charset and collation tests independent of server alias behavior. |
| README.md | Adds Windows-specific WSL and Docker setup instructions. |
Review effort: Balanced
|
The charset suite passes locally on MariaDB 11.8 in randomized single-site and multisite runs: 100 tests, 203 assertions, one existing skip in each. The explicit three-byte fixtures preserve their intended distinction. This does not independently verify MariaDB 13.1, and six CI jobs remain cancelled. Optional scope cleanup: please move the unrelated Windows/WSL README instructions to a separate PR. AI review · |
lancewillett
left a comment
There was a problem hiding this comment.
Verified on actual MariaDB 13.1.2 with its default empty old_mode, PHP 8.3 and PHPUnit 9.6.38. The existing charset suite had four failures before the patch in both single-site and multisite. With the patch, both runs passed: 100 tests, 203 assertions, one unchanged existing skip, using the same random seed. PHP lint and coding standards also pass.
The explicit utf8mb3 fixtures restore the intended three-byte/four-byte distinction; this fixes a server-dependent fixture assumption without weakening those assertions.
I refreshed the branch from trunk. The already-landed README change drops out, and the reviewed charset patch is unchanged. Approved; fresh CI is running before landing.
AI review · gpt-6
Use `utf8mb3` where fixtures require three-byte UTF-8, and explicit `utf8mb4` collations for the connection test. This avoids relying on the `utf8` alias, which resolves to `utf8mb4` by default in MariaDB 13.1. Developed in: #13497 Props micahele. Fixes #66072. git-svn-id: https://develop.svn.wordpress.org/trunk@65155 602fd350-edb4-49c9-b593-d223f7449a82
Use `utf8mb3` where fixtures require three-byte UTF-8, and explicit `utf8mb4` collations for the connection test. This avoids relying on the `utf8` alias, which resolves to `utf8mb4` by default in MariaDB 13.1. Developed in: WordPress/wordpress-develop#13497 Props micahele. Fixes #66072. Built from https://develop.svn.wordpress.org/trunk@65155 git-svn-id: http://core.svn.wordpress.org/trunk@64304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
On MariaDB 13.1, four database tests fail. MariaDB changed what the
utf8character set name means. It used to mean the older 3-byte version (utf8mb3), and now it meansutf8mb4.WordPress itself isn't affected. Only the tests are, because they used
utf8and expected the old meaning.This PR updates the tests so they say exactly which character set they mean:
utf8mb3instead ofutf8.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.--old-mode=(same change as 13.1)To run them:
vendor/bin/phpunit tests/phpunit/tests/db/charset.phpTrac 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.