WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 20 months ago

#38036 new enhancement

Add support for the utf8mb4_0900_ai_ci collation

Reported by: pento Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Database Keywords:
Focuses: Cc:
PR Number:

Description

MySQL 8.0 adds the utf8mb4_0900_ai_ci collation, based on the current Unicode Collation algorithm. We should use it when possible.

Note that the version check will need to be a little more complex than the utf8mb4_520 check - MariaDB 10.x doesn't support utf8mb4_0900_ai_ci.

Change History (4)

#1 @pento
3 years ago

This will probably need a method to detect server vendor - when we add this, the changes related to #33171 will probably need to be updated.

#2 @markoheijnen
3 years ago

Current check is already broken for MariaDB. I'm running version 10.1.18 which has support for utf8mb4_unicode_520_ci but shows up as 5.5.5-10.1.18-MariaDB-1~jessie. So ends up being version 5.5.5. So lower then 5.6.

I assume using a query like "SHOW COLLATION;" would be to slow?

#3 @pento
3 years ago

Ugh, that's annoying. Thanks for the info, @markoheijnen. I'll have to do some testing and see what we can come up with.

I'd like to avoid a SHOW COLLATIONS call if at all possible.

#4 @sierkb
20 months ago

Any progress in this issue?

If using MySQL 8.0, would an explicit
define('DB_CHARSET', 'utf8mb4');
define('DB_COLLATE', 'utf8mb4_0900_ai_ci');
in wp-config.php be usefull right now?

If using MySQL 5.7.x, what should be used instead?
What are the defaults in WordPress as of today?
define('DB_CHARSET', 'utf8'); ?
define('DB_COLLATE', 'utf8mb4_unicode_ci'); ?

Note: See TracTickets for help on using tickets.