WPDB: If a site is using the utf8 charset, and their version of MySQL supports utf8mb4, auto-upgrade them to utf8mb4.

This patch also resizes some indexes, to allow for the 767 byte index size limit in standard MySQL installs.

See #21212



git-svn-id: https://develop.svn.wordpress.org/trunk@31349 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast
2015-02-06 04:50:19 +00:00
parent 43789f822a
commit 9f6ddf8944
6 changed files with 151 additions and 25 deletions

View File

@@ -280,6 +280,11 @@ switch($step) {
case 'DB_HOST' :
$config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "');\r\n";
break;
case 'DB_CHARSET' :
if ( 'utf8mb4' === $wpdb->charset || ( ! $wpdb->charset && $wpdb->has_cap( 'utf8mb4' ) ) ) {
$config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'utf8mb4');\r\n";
}
break;
case 'AUTH_KEY' :
case 'SECURE_AUTH_KEY' :
case 'LOGGED_IN_KEY' :