Make WordPress Core


Ignore:
Timestamp:
04/04/2024 03:11:37 PM (12 months ago)
Author:
johnbillion
Message:

Database: Remove back-compat for database servers that don't support utf8mb4.

Since WordPress 6.5, the minimum supported version of MySQL and MariaDB is 5.5.5. This means all supported database servers now support the utf8mb4 character set and therefore the conditional logic for this is no longer necessary.

Props l1nuxjedi, craigfrancis, OllieJones, johnbillion

Fixes #60096

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/db/charset.php

    r57239 r57926  
    521521        } else {
    522522            $new_charset = $data[0]['charset'];
    523         }
    524 
    525         if ( 'utf8mb4' === $new_charset && ! self::$_wpdb->has_cap( 'utf8mb4' ) ) {
    526             $this->markTestSkipped( "The current MySQL server doesn't support the utf8mb4 character set." );
    527523        }
    528524
     
    796792    public function test_get_table_charset( $drop, $create, $table, $expected_charset ) {
    797793        self::$_wpdb->query( $drop );
    798 
    799         if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
    800             $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
    801         }
    802 
    803794        self::$_wpdb->query( $create );
    804795
     
    837828    public function test_get_column_charset( $drop, $create, $table, $expected_charset ) {
    838829        self::$_wpdb->query( $drop );
    839 
    840         if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
    841             $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
    842         }
    843 
    844830        self::$_wpdb->query( $create );
    845831
     
    865851        self::$_wpdb->query( $drop );
    866852
    867         if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
    868             $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
    869         }
    870 
    871853        self::$_wpdb->is_mysql = false;
    872854
     
    891873    public function test_get_column_charset_is_mysql_undefined( $drop, $create, $table, $columns ) {
    892874        self::$_wpdb->query( $drop );
    893 
    894         if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
    895             $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
    896         }
    897875
    898876        unset( self::$_wpdb->is_mysql );
     
    953931    public function test_strip_invalid_text_from_query( $create, $query, $expected, $drop ) {
    954932        self::$_wpdb->query( $drop );
    955 
    956         if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
    957             $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
    958         }
    959 
    960933        self::$_wpdb->query( $create );
    961934
Note: See TracChangeset for help on using the changeset viewer.