Upgrades: wp_usermeta is a global table in multisite, so it should only be upgraded by the single site routines when we're not in a multisite install.

See #21212


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


git-svn-id: http://core.svn.wordpress.org/trunk@31339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2015-02-06 13:41:22 +00:00
parent e5a5992e2c
commit d7c6ac95bc
2 changed files with 5 additions and 3 deletions

View File

@ -1530,6 +1530,7 @@ function upgrade_network() {
// 4.2
if ( $wp_current_db_version < 31351 && $wpdb->charset === 'utf8mb4' ) {
if ( ! ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) && DO_NOT_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->site DROP INDEX domain, ADD INDEX domain(domain(140),path(51))" );
$wpdb->query( "ALTER TABLE $wpdb->sitemeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
$wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain, ADD INDEX domain(domain(140),path(51))" );
@ -2356,8 +2357,9 @@ function pre_schema_upgrade() {
// Upgrade versions prior to 4.2.
if ( $wp_current_db_version < 31351 ) {
// So that we can change tables to utf8mb4, we need to shorten the index lengths to less than 767 bytes
$wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
if ( ! is_multisite() ) {
$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))" );
$wpdb->query( "ALTER TABLE $wpdb->terms DROP INDEX name, ADD INDEX name(name(191))" );
$wpdb->query( "ALTER TABLE $wpdb->commentmeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-alpha-31357';
$wp_version = '4.2-alpha-31358';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.