<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[57926] trunk: Database: Remove back-compat for database servers that don't support `utf8mb4`.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/57926">57926</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/57926","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>johnbillion</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-04-04 15:11:37 +0000 (Thu, 04 Apr 2024)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>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 <a href="https://core.trac.wordpress.org/ticket/60096">#60096</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesclasswpsitehealthphp">trunk/src/wp-admin/includes/class-wp-site-health.php</a></li>
<li><a href="#trunksrcwpadminsetupconfigphp">trunk/src/wp-admin/setup-config.php</a></li>
<li><a href="#trunksrcwpincludesclasswpdbphp">trunk/src/wp-includes/class-wpdb.php</a></li>
<li><a href="#trunktestsphpunittestsdbcharsetphp">trunk/tests/phpunit/tests/db/charset.php</a></li>
<li><a href="#trunktestsphpunittestsdbdbDeltaphp">trunk/tests/phpunit/tests/db/dbDelta.php</a></li>
<li><a href="#trunktestsphpunittestsdbphp">trunk/tests/phpunit/tests/db.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesclasswpsitehealthphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-site-health.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-site-health.php      2024-04-04 13:54:12 UTC (rev 57925)
+++ trunk/src/wp-admin/includes/class-wp-site-health.php        2024-04-04 15:11:37 UTC (rev 57926)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1284,120 +1284,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * Tests if the database server is capable of using utf8mb4.
-        *
-        * @since 5.2.0
-        *
-        * @return array The test results.
-        */
-       public function get_test_utf8mb4_support() {
-               if ( ! $this->mysql_server_version ) {
-                       $this->prepare_sql_data();
-               }
-
-               $result = array(
-                       'label'       => __( 'UTF8MB4 is supported' ),
-                       'status'      => 'good',
-                       'badge'       => array(
-                               'label' => __( 'Performance' ),
-                               'color' => 'blue',
-                       ),
-                       'description' => sprintf(
-                               '<p>%s</p>',
-                               __( 'UTF8MB4 is the character set WordPress prefers for database storage because it safely supports the widest set of characters and encodings, including Emoji, enabling better support for non-English languages.' )
-                       ),
-                       'actions'     => '',
-                       'test'        => 'utf8mb4_support',
-               );
-
-               if ( ! $this->is_mariadb ) {
-                       if ( version_compare( $this->mysql_server_version, '5.5.3', '<' ) ) {
-                               $result['status'] = 'recommended';
-
-                               $result['label'] = __( 'utf8mb4 requires a MySQL update' );
-
-                               $result['description'] .= sprintf(
-                                       '<p>%s</p>',
-                                       sprintf(
-                                               /* translators: %s: Version number. */
-                                               __( 'WordPress&#8217; utf8mb4 support requires MySQL version %s or greater. Please contact your server administrator.' ),
-                                               '5.5.3'
-                                       )
-                               );
-                       } else {
-                               $result['description'] .= sprintf(
-                                       '<p>%s</p>',
-                                       __( 'Your MySQL version supports utf8mb4.' )
-                               );
-                       }
-               } else { // MariaDB introduced utf8mb4 support in 5.5.0.
-                       if ( version_compare( $this->mysql_server_version, '5.5.0', '<' ) ) {
-                               $result['status'] = 'recommended';
-
-                               $result['label'] = __( 'utf8mb4 requires a MariaDB update' );
-
-                               $result['description'] .= sprintf(
-                                       '<p>%s</p>',
-                                       sprintf(
-                                               /* translators: %s: Version number. */
-                                               __( 'WordPress&#8217; utf8mb4 support requires MariaDB version %s or greater. Please contact your server administrator.' ),
-                                               '5.5.0'
-                                       )
-                               );
-                       } else {
-                               $result['description'] .= sprintf(
-                                       '<p>%s</p>',
-                                       __( 'Your MariaDB version supports utf8mb4.' )
-                               );
-                       }
-               }
-
-               // phpcs:ignore WordPress.DB.RestrictedFunctions.mysql_mysqli_get_client_info
-               $mysql_client_version = mysqli_get_client_info();
-
-               /*
-                * libmysql has supported utf8mb4 since 5.5.3, same as the MySQL server.
-                * mysqlnd has supported utf8mb4 since 5.0.9.
-                */
-               if ( str_contains( $mysql_client_version, 'mysqlnd' ) ) {
-                       $mysql_client_version = preg_replace( '/^\D+([\d.]+).*/', '$1', $mysql_client_version );
-                       if ( version_compare( $mysql_client_version, '5.0.9', '<' ) ) {
-                               $result['status'] = 'recommended';
-
-                               $result['label'] = __( 'utf8mb4 requires a newer client library' );
-
-                               $result['description'] .= sprintf(
-                                       '<p>%s</p>',
-                                       sprintf(
-                                               /* translators: 1: Name of the library, 2: Number of version. */
-                                               __( 'WordPress&#8217; utf8mb4 support requires MySQL client library (%1$s) version %2$s or newer. Please contact your server administrator.' ),
-                                               'mysqlnd',
-                                               '5.0.9'
-                                       )
-                               );
-                       }
-               } else {
-                       if ( version_compare( $mysql_client_version, '5.5.3', '<' ) ) {
-                               $result['status'] = 'recommended';
-
-                               $result['label'] = __( 'utf8mb4 requires a newer client library' );
-
-                               $result['description'] .= sprintf(
-                                       '<p>%s</p>',
-                                       sprintf(
-                                               /* translators: 1: Name of the library, 2: Number of version. */
-                                               __( 'WordPress&#8217; utf8mb4 support requires MySQL client library (%1$s) version %2$s or newer. Please contact your server administrator.' ),
-                                               'libmysql',
-                                               '5.5.3'
-                                       )
-                               );
-                       }
-               }
-
-               return $result;
-       }
-
-       /**
</del><span class="cx" style="display: block; padding: 0 10px">          * Tests if the site can communicate with WordPress.org.
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 5.2.0
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2739,10 +2625,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        'label' => __( 'Database Server version' ),
</span><span class="cx" style="display: block; padding: 0 10px">                                        'test'  => 'sql_server',
</span><span class="cx" style="display: block; padding: 0 10px">                                ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                'utf8mb4_support'              => array(
-                                       'label' => __( 'MySQL utf8mb4 support' ),
-                                       'test'  => 'utf8mb4_support',
-                               ),
</del><span class="cx" style="display: block; padding: 0 10px">                                 'ssl_support'                  => array(
</span><span class="cx" style="display: block; padding: 0 10px">                                        'label' => __( 'Secure communication' ),
</span><span class="cx" style="display: block; padding: 0 10px">                                        'test'  => 'ssl_support',
</span></span></pre></div>
<a id="trunksrcwpadminsetupconfigphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/setup-config.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/setup-config.php       2024-04-04 13:54:12 UTC (rev 57925)
+++ trunk/src/wp-admin/setup-config.php 2024-04-04 15:11:37 UTC (rev 57926)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -396,7 +396,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                        $config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "' );\r\n";
</span><span class="cx" style="display: block; padding: 0 10px">                                        break;
</span><span class="cx" style="display: block; padding: 0 10px">                                case 'DB_CHARSET':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                        if ( 'utf8mb4' === $wpdb->charset || ( ! $wpdb->charset && $wpdb->has_cap( 'utf8mb4' ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                                 if ( 'utf8mb4' === $wpdb->charset || ( ! $wpdb->charset ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                                                 $config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'utf8mb4' );\r\n";
</span><span class="cx" style="display: block; padding: 0 10px">                                        }
</span><span class="cx" style="display: block; padding: 0 10px">                                        break;
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpdbphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wpdb.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wpdb.php      2024-04-04 13:54:12 UTC (rev 57925)
+++ trunk/src/wp-includes/class-wpdb.php        2024-04-04 15:11:37 UTC (rev 57926)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -878,15 +878,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        return compact( 'charset', 'collate' );
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( 'utf8' === $charset && $this->has_cap( 'utf8mb4' ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         if ( 'utf8' === $charset ) {
</ins><span class="cx" style="display: block; padding: 0 10px">                         $charset = 'utf8mb4';
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( 'utf8mb4' === $charset && ! $this->has_cap( 'utf8mb4' ) ) {
-                       $charset = 'utf8';
-                       $collate = str_replace( 'utf8mb4_', 'utf8_', $collate );
-               }
-
</del><span class="cx" style="display: block; padding: 0 10px">                 if ( 'utf8mb4' === $charset ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        // _general_ is outdated, so we can upgrade it to _unicode_, instead.
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( ! $collate || 'utf8_general_ci' === $collate ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3242,11 +3237,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( ! empty( $column->Collation ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">                                list( $charset ) = explode( '_', $column->Collation );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                // If the current connection can't support utf8mb4 characters, let's only send 3-byte utf8 characters.
-                               if ( 'utf8mb4' === $charset && ! $this->has_cap( 'utf8mb4' ) ) {
-                                       $charset = 'utf8';
-                               }
-
</del><span class="cx" style="display: block; padding: 0 10px">                                 $charsets[ strtolower( $charset ) ] = true;
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4057,6 +4047,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 4.1.0 Added support for the 'utf8mb4' feature.
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 4.6.0 Added support for the 'utf8mb4_520' feature.
</span><span class="cx" style="display: block; padding: 0 10px">         * @since 6.2.0 Added support for the 'identifier_placeholders' feature.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * @since 6.6.0 The `utf8mb4` feature now always returns true.
</ins><span class="cx" style="display: block; padding: 0 10px">          *
</span><span class="cx" style="display: block; padding: 0 10px">         * @see wpdb::db_version()
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4092,26 +4083,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        case 'set_charset':
</span><span class="cx" style="display: block; padding: 0 10px">                                return version_compare( $db_version, '5.0.7', '>=' );
</span><span class="cx" style="display: block; padding: 0 10px">                        case 'utf8mb4':      // @since 4.1.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                if ( version_compare( $db_version, '5.5.3', '<' ) ) {
-                                       return false;
-                               }
-
-                               $client_version = mysqli_get_client_info();
-
-                               /*
-                                * libmysql has supported utf8mb4 since 5.5.3, same as the MySQL server.
-                                * mysqlnd has supported utf8mb4 since 5.0.9.
-                                *
-                                * Note: str_contains() is not used here, as this file can be included
-                                * directly outside of WordPress core, e.g. by HyperDB, in which case
-                                * the polyfills from wp-includes/compat.php are not loaded.
-                                */
-                               if ( false !== strpos( $client_version, 'mysqlnd' ) ) {
-                                       $client_version = preg_replace( '/^\D+([\d.]+).*/', '$1', $client_version );
-                                       return version_compare( $client_version, '5.0.9', '>=' );
-                               } else {
-                                       return version_compare( $client_version, '5.5.3', '>=' );
-                               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         return true;
</ins><span class="cx" style="display: block; padding: 0 10px">                         case 'utf8mb4_520': // @since 4.6.0
</span><span class="cx" style="display: block; padding: 0 10px">                                return version_compare( $db_version, '5.6', '>=' );
</span><span class="cx" style="display: block; padding: 0 10px">                        case 'identifier_placeholders': // @since 6.2.0
</span></span></pre></div>
<a id="trunktestsphpunittestsdbcharsetphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/db/charset.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/db/charset.php  2024-04-04 13:54:12 UTC (rev 57925)
+++ trunk/tests/phpunit/tests/db/charset.php    2024-04-04 15:11:37 UTC (rev 57926)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -522,10 +522,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $new_charset = $data[0]['charset'];
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( 'utf8mb4' === $new_charset && ! self::$_wpdb->has_cap( 'utf8mb4' ) ) {
-                       $this->markTestSkipped( "The current MySQL server doesn't support the utf8mb4 character set." );
-               }
-
</del><span class="cx" style="display: block; padding: 0 10px">                 if ( 'big5' === $new_charset && 'byte' === $data[0]['length']['type']
</span><span class="cx" style="display: block; padding: 0 10px">                        && str_contains( self::$db_server_info, 'MariaDB' )
</span><span class="cx" style="display: block; padding: 0 10px">                ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -795,11 +791,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_table_charset( $drop, $create, $table, $expected_charset ) {
</span><span class="cx" style="display: block; padding: 0 10px">                self::$_wpdb->query( $drop );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-               if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
-                       $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
-               }
-
</del><span class="cx" style="display: block; padding: 0 10px">                 self::$_wpdb->query( $create );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $charset = self::$_wpdb->get_table_charset( $table );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -836,11 +827,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_column_charset( $drop, $create, $table, $expected_charset ) {
</span><span class="cx" style="display: block; padding: 0 10px">                self::$_wpdb->query( $drop );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-               if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
-                       $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
-               }
-
</del><span class="cx" style="display: block; padding: 0 10px">                 self::$_wpdb->query( $create );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                foreach ( $expected_charset as $column => $charset ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -864,10 +850,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_column_charset_non_mysql( $drop, $create, $table, $columns ) {
</span><span class="cx" style="display: block; padding: 0 10px">                self::$_wpdb->query( $drop );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
-                       $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
-               }
-
</del><span class="cx" style="display: block; padding: 0 10px">                 self::$_wpdb->is_mysql = false;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                self::$_wpdb->query( $create );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -891,10 +873,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_get_column_charset_is_mysql_undefined( $drop, $create, $table, $columns ) {
</span><span class="cx" style="display: block; padding: 0 10px">                self::$_wpdb->query( $drop );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
-                       $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
-               }
-
</del><span class="cx" style="display: block; padding: 0 10px">                 unset( self::$_wpdb->is_mysql );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                self::$_wpdb->query( $create );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -952,11 +930,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_strip_invalid_text_from_query( $create, $query, $expected, $drop ) {
</span><span class="cx" style="display: block; padding: 0 10px">                self::$_wpdb->query( $drop );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
-               if ( ! self::$_wpdb->has_cap( 'utf8mb4' ) && preg_match( '/utf8mb[34]/i', $create ) ) {
-                       $this->markTestSkipped( "This version of MySQL doesn't support utf8mb4." );
-               }
-
</del><span class="cx" style="display: block; padding: 0 10px">                 self::$_wpdb->query( $create );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $return = self::$_wpdb->strip_invalid_text_from_query( $query );
</span></span></pre></div>
<a id="trunktestsphpunittestsdbdbDeltaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/db/dbDelta.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/db/dbDelta.php  2024-04-04 13:54:12 UTC (rev 57925)
+++ trunk/tests/phpunit/tests/db/dbDelta.php    2024-04-04 15:11:37 UTC (rev 57926)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -426,10 +426,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_truncated_index() {
</span><span class="cx" style="display: block; padding: 0 10px">                global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( ! $wpdb->has_cap( 'utf8mb4' ) ) {
-                       $this->markTestSkipped( 'This test requires utf8mb4 support in MySQL.' );
-               }
-
</del><span class="cx" style="display: block; padding: 0 10px">                 // This table needs to be actually created.
</span><span class="cx" style="display: block; padding: 0 10px">                remove_filter( 'query', array( $this, '_create_temporary_tables' ) );
</span><span class="cx" style="display: block; padding: 0 10px">                remove_filter( 'query', array( $this, '_drop_temporary_tables' ) );
</span></span></pre></div>
<a id="trunktestsphpunittestsdbphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/db.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/db.php  2024-04-04 13:54:12 UTC (rev 57925)
+++ trunk/tests/phpunit/tests/db.php    2024-04-04 15:11:37 UTC (rev 57926)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1439,10 +1439,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_charset_switched_to_utf8mb4() {
</span><span class="cx" style="display: block; padding: 0 10px">                global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( ! $wpdb->has_cap( 'utf8mb4' ) ) {
-                       $this->markTestSkipped( 'This test requires utf8mb4 support.' );
-               }
-
</del><span class="cx" style="display: block; padding: 0 10px">                 $charset = 'utf8';
</span><span class="cx" style="display: block; padding: 0 10px">                $collate = 'utf8_general_ci';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1477,10 +1473,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_non_unicode_collations() {
</span><span class="cx" style="display: block; padding: 0 10px">                global $wpdb;
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( ! $wpdb->has_cap( 'utf8mb4' ) ) {
-                       $this->markTestSkipped( 'This test requires utf8mb4 support.' );
-               }
-
</del><span class="cx" style="display: block; padding: 0 10px">                 $charset = 'utf8';
</span><span class="cx" style="display: block; padding: 0 10px">                $collate = 'utf8_swedish_ci';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1490,25 +1482,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-         * @ticket 37982
-        */
-       public function test_charset_switched_to_utf8() {
-               global $wpdb;
-
-               if ( $wpdb->has_cap( 'utf8mb4' ) ) {
-                       $this->markTestSkipped( 'This test requires utf8mb4 to not be supported.' );
-               }
-
-               $charset = 'utf8mb4';
-               $collate = 'utf8mb4_general_ci';
-
-               $result = $wpdb->determine_charset( $charset, $collate );
-
-               $this->assertSame( 'utf8', $result['charset'] );
-               $this->assertSame( 'utf8_general_ci', $result['collate'] );
-       }
-
-       /**
</del><span class="cx" style="display: block; padding: 0 10px">          * @dataProvider data_prepare_with_placeholders
</span><span class="cx" style="display: block; padding: 0 10px">         */
</span><span class="cx" style="display: block; padding: 0 10px">        public function test_prepare_with_placeholders_and_individual_args( $sql, $values, $incorrect_usage, $expected ) {
</span></span></pre>
</div>
</div>

</body>
</html>