After [34529], if a compatible `termmeta` table is found on database upgrade, convert it to `utf8mb4` collation.

Props dboulet.
Fixes #34224.
Built from https://develop.svn.wordpress.org/trunk@34978


git-svn-id: http://core.svn.wordpress.org/trunk@34943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-10-09 02:07:25 +00:00
parent a6cf0b41a6
commit 3c7b7f7133
2 changed files with 5 additions and 4 deletions

View File

@ -2630,10 +2630,11 @@ function pre_schema_upgrade() {
}
// Upgrade versions prior to 4.4.
if ( $wp_current_db_version < 34370 ) {
// If compatible termmeta table is found, use it, but enforce a proper index.
if ( $wp_current_db_version < 34978 ) {
// If compatible termmeta table is found, use it, but enforce a proper index and update collation.
if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->termmeta}'" ) && $wpdb->get_results( "SHOW INDEX FROM {$wpdb->termmeta} WHERE Column_name = 'meta_key'" ) ) {
$wpdb->query( "ALTER TABLE $wpdb->termmeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
maybe_convert_table_to_utf8mb4( $wpdb->termmeta );
}
}
}

View File

@ -4,14 +4,14 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34977';
$wp_version = '4.4-alpha-34978';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
*
* @global int $wp_db_version
*/
$wp_db_version = 34903;
$wp_db_version = 34978;
/**
* Holds the TinyMCE version