dbDelta doesn't allow for automatically truncated indexes
|Reported by:||pento||Owned by:||pento|
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.