WordPress.org

Make WordPress Core

Changeset 31358


Ignore:
Timestamp:
02/06/2015 01:40:17 PM (5 years ago)
Author:
pento
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r31354 r31358  
    15311531    if ( $wp_current_db_version < 31351 && $wpdb->charset === 'utf8mb4' ) {
    15321532        if ( ! ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) && DO_NOT_UPGRADE_GLOBAL_TABLES ) ) {
     1533            $wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
    15331534            $wpdb->query( "ALTER TABLE $wpdb->site DROP INDEX domain, ADD INDEX domain(domain(140),path(51))" );
    15341535            $wpdb->query( "ALTER TABLE $wpdb->sitemeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
     
    23572358    // Upgrade versions prior to 4.2.
    23582359    if ( $wp_current_db_version < 31351 ) {
    2359         // So that we can change tables to utf8mb4, we need to shorten the index lengths to less than 767 bytes
    2360         $wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
     2360        if ( ! is_multisite() ) {
     2361            $wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
     2362        }
    23612363        $wpdb->query( "ALTER TABLE $wpdb->terms DROP INDEX slug, ADD INDEX slug(slug(191))" );
    23622364        $wpdb->query( "ALTER TABLE $wpdb->terms DROP INDEX name, ADD INDEX name(name(191))" );
Note: See TracChangeset for help on using the changeset viewer.