WordPress.org

Make WordPress Core

Changeset 32380


Ignore:
Timestamp:
05/06/15 07:41:55 (3 years ago)
Author:
pento
Message:

Upgrades: When converting to utf8mb4, we were trying to change the wrong index on wp_signups, causing the conversion to later fail.

Merge [32378] to the 4.2 branch.

Props kovshenin, pento.

Fixes #32099.

Location:
branches/4.2/src
Files:
2 edited

Legend:

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

    r32367 r32380  
    15931593            $wpdb->query( "ALTER TABLE $wpdb->site DROP INDEX domain, ADD INDEX domain(domain(140),path(51))" ); 
    15941594            $wpdb->query( "ALTER TABLE $wpdb->sitemeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" ); 
    1595             $wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain, ADD INDEX domain(domain(140),path(51))" ); 
     1595            $wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain_path, ADD INDEX domain_path(domain(140),path(51))" ); 
    15961596 
    15971597            $tables = $wpdb->tables( 'global' ); 
     
    15991599            foreach ( $tables as $table ) { 
    16001600                maybe_convert_table_to_utf8mb4( $table ); 
     1601            } 
     1602        } 
     1603    } 
     1604 
     1605    // 4.2.2 
     1606    if ( $wp_current_db_version < 31535 && 'utf8mb4' === $wpdb->charset ) { 
     1607        if ( ! ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) && DO_NOT_UPGRADE_GLOBAL_TABLES ) ) { 
     1608            $upgrade = false; 
     1609            $indexes = $wpdb->get_results( "SHOW INDEXES FROM $wpdb->signups" ); 
     1610            foreach( $indexes as $index ) { 
     1611                if ( 'domain_path' == $index->Key_name && 'domain' == $index->Column_name && 140 != $index->Sub_part ) { 
     1612                    $upgrade = true; 
     1613                    break; 
     1614                } 
     1615            } 
     1616 
     1617            if ( $upgrade ) { 
     1618                $wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain_path, ADD INDEX domain_path(domain(140),path(51))" ); 
    16011619            } 
    16021620        } 
  • branches/4.2/src/wp-includes/version.php

    r32369 r32380  
    1212 * @global int $wp_db_version 
    1313 */ 
    14 $wp_db_version = 31534; 
     14$wp_db_version = 31535; 
    1515 
    1616/** 
Note: See TracChangeset for help on using the changeset viewer.