WordPress.org

Make WordPress Core

Opened 7 months ago

Last modified 11 hours ago

#53623 new defect (bug)

MariaDB 10.6 renamed utf8 to utf8mb3

Reported by: skithund Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Database Keywords: needs-patch
Focuses: Cc:

Description

See MariaDB ticket MDEV-8334 "Rename utf8 to utf8mb3"

Which results in charset tests are now failing.

Change History (7)

#1 @ayeshrajans
7 months ago

Very nice find :)
I suppose we can conditionally assertSame by checking the db version and the name.

From what I see, self::$server_info contains MariaDB, and self::$_wpdb->db_version() returns the version. I don't have a MariaDB test setup at the moment, and will try to put forth a patch this weekend. Just wanted to share my 2 cents in the meantime.

This ticket was mentioned in Slack in #forums by yui. View the logs.


7 months ago

This ticket was mentioned in Slack in #hosting-community by yui. View the logs.


7 months ago

#4 @ayeshrajans
6 months ago

MySQL 8.0.26 also has related changes: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-26.html


These statements now report utf8mb3 rather than utf8 when writing character set names: EXPLAIN, SHOW CREATE PROCEDURE, SHOW CREATE EVENT.

Stored program definitions retrieved from the data dictionary now report utf8mb3 rather than utf8 in character set references. This affects any output produced from those definitions, such as SHOW CREATE statements.

This error message now reports utf8mb3 rather than utf8 when writing character set names: ER_INVALID_CHARACTER_STRING. (Bug #32233614, Bug #32392077, Bug #32392209, Bug #32428538, Bug #32428598)

#5 @desrosj
2 months ago

  • Milestone changed from Awaiting Review to Future Release

#6 follow-up: @JavierCasares
15 hours ago

Tested with:

  • PHP 7.1 -> 8.1
  • MariaDB 10.6

This makes some test errors:

  • Tests_DB_Charset::test_set_charset_changes_the_connection_collation
    Failed asserting that two strings are identical.
    --- Expected
    +++ Actual
    @@ @@
    -'utf8_general_ci'
    +'utf8mb3_general_ci'
    
  • Tests_DB_Charset::test_get_column_charset::test_get_column_charset with data set #5
    Failed asserting that two strings are identical.
    --- Expected
    +++ Actual
    @@ @@
    -'utf8'
    +'utf8mb3'
    
  • Tests_DB_Charset::test_get_column_charset::test_get_column_charset with data set #6
    Failed asserting that two strings are identical.
    --- Expected
    +++ Actual
    @@ @@
    -'utf8'
    +'utf8mb3'
    
  • Tests_DB_Charset::test_table_collation_check::test_table_collation_check with data set #0
    ('CREATE TABLE table_collation_..._bin )', true, 'SELECT * FROM table_collation... a='😈'', 'DROP TABLE IF EXISTS table_co...heck_0', array('SELECT * FROM table_collation...='foo'', 'SHOW FULL TABLES LIKE table_c...heck_0', 'DESCRIBE table_collation_check_0', 'DESC table_collation_check_0', 'EXPLAIN SELECT * FROM table_c...heck_0'))
    Failed asserting that false is identical to true.
    
  • Tests_DB_Charset::test_table_collation_check::test_table_collation_check with data set #1
     ('CREATE TABLE table_collation_...l_ci )', true, 'SELECT * FROM table_collation... a='😈'', 'DROP TABLE IF EXISTS table_co...heck_1', array('SELECT * FROM table_collation...='foo'', 'SHOW FULL TABLES LIKE table_c...heck_1', 'DESCRIBE table_collation_check_1', 'DESC table_collation_check_1', 'EXPLAIN SELECT * FROM table_c...heck_1'))
    Failed asserting that false is identical to true.
    
  • Tests_DB_Charset::test_table_collation_check::test_table_collation_check with data set #4
    ('CREATE TABLE table_collation_... INT )', true, 'SELECT * FROM table_collation... a='😈'', 'DROP TABLE IF EXISTS table_co...heck_4', array('SELECT * FROM table_collation...='foo'', 'SHOW FULL TABLES LIKE table_c...heck_4', 'DESCRIBE table_collation_check_4', 'DESC table_collation_check_4', 'EXPLAIN SELECT * FROM table_c...heck_4'))
    Failed asserting that false is identical to true.
    

Also... should WordPress set the default charset to "utf8mb4"?

#7 in reply to: ↑ 6 @SergeyBiryukov
11 hours ago

Replying to JavierCasares:

Also... should WordPress set the default charset to "utf8mb4"?

I believe that would be best discussed in #48285. Related: #45697.

Note: See TracTickets for help on using tickets.