Don't upgrade global tables to utf8mb4 when wp_should_upgrade_global_tables() says not to.

Additionally fixes an incorrect conditional in [33057] which would result in the usermeta index being altered twice on Multisite updates.

See #32154

Built from https://develop.svn.wordpress.org/trunk@33058


git-svn-id: http://core.svn.wordpress.org/trunk@33029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2015-07-03 05:44:24 +00:00
parent d651de0dac
commit 36de491d68
2 changed files with 7 additions and 3 deletions

View File

@ -1514,6 +1514,10 @@ function upgrade_430() {
$tables = $wpdb->tables( 'blog' );
} else {
$tables = $wpdb->tables( 'all' );
if ( ! wp_should_upgrade_global_tables() ) {
$global_tables = $wpdb->tables( 'global' );
$tables = array_diff_assoc( $tables, $global_tables );
}
}
foreach ( $tables as $table ) {
@ -2634,7 +2638,7 @@ function pre_schema_upgrade() {
// Upgrade versions prior to 4.2.
if ( $wp_current_db_version < 31351 ) {
if ( wp_should_upgrade_global_tables() ) {
if ( ! is_multisite() && wp_should_upgrade_global_tables() ) {
$wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
}
$wpdb->query( "ALTER TABLE $wpdb->terms DROP INDEX slug, ADD INDEX slug(slug(191))" );
@ -2711,7 +2715,7 @@ function wp_should_upgrade_global_tables() {
}
/**
* Filter if upgrade routines should be run on global tables in multisite.
* Filter if upgrade routines should be run on global tables.
*
* @param bool $should_upgrade Whether to run the upgrade routines on global tables.
*/

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-beta1-33057';
$wp_version = '4.3-beta1-33058';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.