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.php

    r57089 r57926  
    14401440        global $wpdb;
    14411441
    1442         if ( ! $wpdb->has_cap( 'utf8mb4' ) ) {
    1443             $this->markTestSkipped( 'This test requires utf8mb4 support.' );
    1444         }
    1445 
    14461442        $charset = 'utf8';
    14471443        $collate = 'utf8_general_ci';
     
    14781474        global $wpdb;
    14791475
    1480         if ( ! $wpdb->has_cap( 'utf8mb4' ) ) {
    1481             $this->markTestSkipped( 'This test requires utf8mb4 support.' );
    1482         }
    1483 
    14841476        $charset = 'utf8';
    14851477        $collate = 'utf8_swedish_ci';
     
    14881480
    14891481        $this->assertSame( 'utf8mb4_swedish_ci', $result['collate'] );
    1490     }
    1491 
    1492     /**
    1493      * @ticket 37982
    1494      */
    1495     public function test_charset_switched_to_utf8() {
    1496         global $wpdb;
    1497 
    1498         if ( $wpdb->has_cap( 'utf8mb4' ) ) {
    1499             $this->markTestSkipped( 'This test requires utf8mb4 to not be supported.' );
    1500         }
    1501 
    1502         $charset = 'utf8mb4';
    1503         $collate = 'utf8mb4_general_ci';
    1504 
    1505         $result = $wpdb->determine_charset( $charset, $collate );
    1506 
    1507         $this->assertSame( 'utf8', $result['charset'] );
    1508         $this->assertSame( 'utf8_general_ci', $result['collate'] );
    15091482    }
    15101483
Note: See TracChangeset for help on using the changeset viewer.