[wp-trac] [WordPress Trac] #31869: dbDelta doesn't allow for automatically truncated indexes

WordPress Trac noreply at wordpress.org
Thu Apr 2 13:28:10 UTC 2015


#31869: dbDelta doesn't allow for automatically truncated indexes
-----------------------------+-------------------------
 Reporter:  pento            |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  4.2
Component:  Upgrade/Install  |    Version:
 Severity:  normal           |   Keywords:  needs-patch
  Focuses:                   |
-----------------------------+-------------------------
 When a table is created with too large an index, MySQL will automatically
 truncate it. For example:

 {{{
 CREATE TABLE foo (
   a VARCHAR(255) CHARACTER SET utf8mb4,
   INDEX (a)
 );
 }}}

 MySQL will automatically truncate the index on `a` to be 191 characters.

 When `dbDelta()` checks `SHOW INDEX FROM foo`, it'll see that the index is
 191 characters, when this wasn't specified in the `CREATE TABLE`
 statement, so it'll try and recreate the index that already exists.

 This bug has probably existed since forever, but will become more
 prominent now that `utf8mb4` is a thing.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31869>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list