Skip to:
Content

bbPress.org

Changeset 6129


Ignore:
Timestamp:
11/30/2016 02:21:32 PM (4 years ago)
Author:
johnjamesjacoby
Message:

Converter: Set maximum key index length to 191.

Fixes bug where table would not be created because utf8mb4 character sets do not have room for that many bytes.

(Also, pass query as an array into dbDelta() so it doesn't need to do the work for us anymore.)

See #3026. (Trunk, for 2.6)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/admin/converter.php

    r6041 r6129  
    650650        }
    651651
     652        $sql = array();
     653        $max_index_length = 191;
     654
    652655        /** Translator ****************************************************/
    653656
    654         $sql = "CREATE TABLE {$table_name} (
     657        $sql[] = "CREATE TABLE {$table_name} (
    655658                    meta_id mediumint(8) unsigned not null auto_increment,
    656659                    value_type varchar(25) null,
     
    658661                    meta_key varchar(255) null,
    659662                    meta_value varchar(255) null,
    660                 PRIMARY KEY  (meta_id),
     663                PRIMARY KEY (meta_id),
    661664                    KEY value_id (value_id),
    662                     KEY meta_join (meta_key, meta_value) ) {$charset_collate};";
     665                    KEY meta_join (meta_key({$max_index_length}), meta_value({$max_index_length}))
     666                ) {$charset_collate};";
    663667
    664668        dbDelta( $sql );
Note: See TracChangeset for help on using the changeset viewer.