Make WordPress Core

Changeset 32378


Ignore:
Timestamp:
05/06/2015 07:33:53 AM (12 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.

Props kovshenin, pento.

See #32099.

Location:
trunk/src
Files:
2 edited

Legend:

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

    r32364 r32378  
    15851585                        $wpdb->query( "ALTER TABLE $wpdb->site DROP INDEX domain, ADD INDEX domain(domain(140),path(51))" );
    15861586                        $wpdb->query( "ALTER TABLE $wpdb->sitemeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
    1587                         $wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain, ADD INDEX domain(domain(140),path(51))" );
     1587                        $wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain_path, ADD INDEX domain_path(domain(140),path(51))" );
    15881588
    15891589                        $tables = $wpdb->tables( 'global' );
    … …  
    15911591                        foreach ( $tables as $table ) {
    15921592                                maybe_convert_table_to_utf8mb4( $table );
     1593                        }
     1594                }
     1595        }
     1596
     1597        // 4.3
     1598        if ( $wp_current_db_version < 31378 && 'utf8mb4' === $wpdb->charset ) {
     1599                if ( ! ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) && DO_NOT_UPGRADE_GLOBAL_TABLES ) ) {
     1600                        $upgrade = false;
     1601                        $indexes = $wpdb->get_results( "SHOW INDEXES FROM $wpdb->signups" );
     1602                        foreach( $indexes as $index ) {
     1603                                if ( 'domain_path' == $index->Key_name && 'domain' == $index->Column_name && 140 != $index->Sub_part ) {
     1604                                        $upgrade = true;
     1605                                        break;
     1606                                }
     1607                        }
     1608
     1609                        if ( $upgrade ) {
     1610                                $wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain_path, ADD INDEX domain_path(domain(140),path(51))" );
    15931611                        }
    15941612                }
  • trunk/src/wp-includes/version.php

    r32366 r32378  
    1212 * @global int $wp_db_version
    1313 */
    14 $wp_db_version = 32364;
     14$wp_db_version = 32378;
    1515
    1616/**
Note: See TracChangeset for help on using the changeset viewer.