WordPress.org

Make WordPress Core

Ticket #13310: 13310.diff

File 13310.diff, 2.6 KB (added by pento, 5 years ago)
  • src/wp-admin/includes/schema.php

     
    135135) $charset_collate;
    136136CREATE TABLE $wpdb->options (
    137137  option_id bigint(20) unsigned NOT NULL auto_increment,
    138   option_name varchar(64) NOT NULL default '',
     138  option_name varchar(255) NOT NULL default '',
    139139  option_value longtext NOT NULL,
    140140  autoload varchar(20) NOT NULL default 'yes',
    141141  PRIMARY KEY  (option_id),
    142   UNIQUE KEY option_name (option_name)
     142  UNIQUE KEY option_name (option_name($max_index_length))
    143143) $charset_collate;
    144144CREATE TABLE $wpdb->postmeta (
    145145  meta_id bigint(20) unsigned NOT NULL auto_increment,
  • src/wp-admin/includes/upgrade.php

     
    538538        if ( $wp_current_db_version < 33056 )
    539539                upgrade_431();
    540540
     541        if ( $wp_current_db_version < 33726 )
     542                upgrade_440();
     543
    541544        maybe_disable_link_manager();
    542545
    543546        maybe_disable_automattic_widgets();
     
    15961599}
    15971600
    15981601/**
     1602 * Executes changes made in WordPress 4.4.0.
     1603 *
     1604 * @since 4.4.0
     1605 *
     1606 * @global int  $wp_current_db_version Current version.
     1607 * @global wpdb $wpdb                  WordPress database abstraction object.
     1608 */
     1609function upgrade_440() {
     1610        global $wp_current_db_version, $wpdb;
     1611
     1612        if ( $wp_current_db_version < 33726 ) {
     1613
     1614                $wpdb->hide_errors();
     1615                $wpdb->query( "ALTER TABLE {$wpdb->options} MODIFY option_name VARCHAR(255)" );
     1616                $wpdb->show_errors();
     1617        }
     1618}
     1619
     1620/**
    15991621 * Executes network-level upgrade routines.
    16001622 *
    16011623 * @since 3.0.0
     
    26092631                $wpdb->query( "ALTER TABLE $wpdb->postmeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" );
    26102632                $wpdb->query( "ALTER TABLE $wpdb->posts DROP INDEX post_name, ADD INDEX post_name(post_name(191))" );
    26112633        }
     2634
     2635        // Upgrade versions prior to 4.4.
     2636        if ( $wp_current_db_version < 33726 ) {
     2637                /*
     2638                 * We can't add the new index now, as the index length (191) is longer than the
     2639                 * current column length (64). The index will be recreated later by dbDelta().
     2640                 */
     2641                $wpdb->query( "ALTER TABLE $wpdb->options DROP INDEX option_name" );
     2642        }
    26122643}
    26132644
    26142645/**
  • src/wp-includes/version.php

     
    1111 *
    1212 * @global int $wp_db_version
    1313 */
    14 $wp_db_version = 33056;
     14$wp_db_version = 33726;
    1515
    1616/**
    1717 * Holds the TinyMCE version