Make WordPress Core

Opened 2 years ago

#57072 new defect (bug)

WordPress 6.1 uses wrong database collation

Reported by: krstarica's profile Krstarica Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.1
Component: Database Keywords:
Focuses: Cc:

Description

After upgrade to WordPress 6.1 some plugins started reporting "WordPress database error Illegal mix of collations (utf8mb4_unicode_520_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT)". See: https://wordpress.org/support/topic/database-error-after-upgrade-to-wordpress-6-1/

It seems that WordPress 6.1 wrongly detects database collation. This is probably related to #54841.

Database section of the Site Health page (/wp-admin/site-health.php?tab=debug) displays:

Database charset	utf8mb4
Database collation	utf8mb4_unicode_520_ci

Eariler versions displayed correct one:

Database charset	utf8mb4
Database collation	utf8mb4_unicode_ci

Database collation should be utf8mb4_unicode_ci per server and database configuration:

MariaDB [(none)]> SHOW VARIABLES LIKE '%_server' ;
+----------------------+--------------------+
| Variable_name        | Value              |
+----------------------+--------------------+
| character_set_server | utf8mb4            |
| collation_server     | utf8mb4_unicode_ci |
+----------------------+--------------------+
2 rows in set (0.002 sec)

MariaDB [(none)]> USE wordpress;
Database changed

MariaDB [wordpress]> SELECT @@character_set_database, @@collation_database;
+--------------------------+----------------------+
| @@character_set_database | @@collation_database |
+--------------------------+----------------------+
| utf8mb4                  | utf8mb4_unicode_ci   |
+--------------------------+----------------------+
1 row in set (0.000 sec)

Server version: 10.6.10-MariaDB-log

Having define('DB_COLLATE', ''); in wp-config.php.

Using define( 'DB_COLLATE', 'utf8mb4_unicode_ci' ); did not fix the issue, nor changed collation information in Database section of the Site Health page.

Change History (0)

Note: See TracTickets for help on using tickets.