Tests: Fix database charset tests on MariaDB 13.1 - #13497
Open
MicahelE wants to merge 2 commits into
Open
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. You can also manually ask me to refresh this list by adding the 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.