Skip to:
Content

Opened 2 years ago

Closed 2 years ago

Last modified 18 months ago

#3026 closed defect (fixed)

Converter table does not limit max index lengths of key

Reported by: johnjamesjacoby Owned by:
Milestone: 2.5.12 Priority: high
Severity: major Version: 2.4
Component: API - Importers Keywords: has-patch
Cc:

Description

From https://bbpress.org/forums/topic/smf-to-bbpress-error-utf8mb4/#post-179480.

Since WordPress 4.4, utf8mb4 is the recommended character set and utf8mb4_unicode_ci is the recommended collation. This combination reduces the size of the indexable length down to 191 characters, and the converter table tries to create keys that are 255 characters long.

This will result in the following error:

WordPress database error: [Specified key was too long; max key length is 1000 bytes]
CREATE TABLE wp_bbp_converter_translator ( meta_id mediumint(8) unsigned not null auto_increment, value_type varchar(25) null, value_id bigint(20) unsigned not null default ‘0’, meta_key varchar(255) null, meta_value varchar(255) null, PRIMARY KEY (meta_id), KEY value_id (value_id), KEY meta_join (meta_key, meta_value) ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci

This is a pretty major deal IMO, since anyone trying to convert on any modern WordPress installation will have issues. Recommend we back-port the fix to the 2.5 branch for 2.5.12.

Attachments (1)

3026.patch (1.2 KB) - added by johnjamesjacoby 2 years ago.
Limit maximum index length to 191

Download all attachments as: .zip

Change History (5)

@johnjamesjacoby
2 years ago

Limit maximum index length to 191

#1 @johnjamesjacoby
2 years ago

In 6129:

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)

#2 @johnjamesjacoby
2 years ago

In 6130:

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. (2.5 branch, for 2.5.12)

#3 @johnjamesjacoby
2 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in trunk and 2.5 branch. <3

#4 @netweb
18 months ago

Follow up ticket #3145, $max-index-length was lowered further to 75 in [6666]

Note: See TracTickets for help on using tickets.