Make WordPress Core


Ignore:
Timestamp:
07/03/2015 05:58:20 AM (11 years ago)
Author:
dd32
Message:

Don't upgrade global tables to utf8mb4 when DO_NOT_UPGRADE_GLOBAL_TABLES is defined.
This change also standardises on only checking DO_NOT_UPGRADE_GLOBAL_TABLES is defined, not it's value.

Fixes #32154 for 4.2

Location:
branches/4.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.2

  • branches/4.2/src/wp-admin/includes/upgrade.php

    r32853 r33059  
    14341434                } else {
    14351435                        $tables = $wpdb->tables( 'all' );
     1436                        if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
     1437                                $global_tables = $wpdb->tables( 'global' );
     1438                                $tables = array_diff_assoc( $tables, $global_tables );
     1439                        }
    14361440                }
    14371441
    … …  
    15971601        // 4.2
    15981602        if ( $wp_current_db_version < 31351 && $wpdb->charset === 'utf8mb4' ) {
    1599                 if ( ! ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) && DO_NOT_UPGRADE_GLOBAL_TABLES ) ) {
     1603                if ( ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
    16001604                        $wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
    16011605                        $wpdb->query( "ALTER TABLE $wpdb->site DROP INDEX domain, ADD INDEX domain(domain(140),path(51))" );
    … …  
    16131617        // 4.2.2
    16141618        if ( $wp_current_db_version < 31535 && 'utf8mb4' === $wpdb->charset ) {
    1615                 if ( ! ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) && DO_NOT_UPGRADE_GLOBAL_TABLES ) ) {
     1619                if ( ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
    16161620                        $upgrade = false;
    16171621                        $indexes = $wpdb->get_results( "SHOW INDEXES FROM $wpdb->signups" );
    … …  
    24602464        // Upgrade versions prior to 4.2.
    24612465        if ( $wp_current_db_version < 31351 ) {
    2462                 if ( ! is_multisite() ) {
     2466                if ( ! is_multisite() && ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
    24632467                        $wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
    24642468                }
Note: See TracChangeset for help on using the changeset viewer.