Bug #88196 Upgrading to 8.0.3 fails if foreign keys of exactly 64 characters are present
Submitted: 24 Oct 2017 6:38 Modified: 16 Nov 2017 15:07
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S1 (Critical)
Version:8.0.3 OS:Any
Assigned to: CPU Architecture:Any

[24 Oct 2017 6:38] Shane Bester
Description:
See https://bugs.mysql.com/bug.php?id=88118

8.0 fails to start on a 5.7 data directory with long FK names.

 [Note] Created Data Dictionary for upgrade
 [ERROR] E:\mysql-8.0.3-rc-winx64\bin\mysqld.exe: Identifier name 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' is too long
 [ERROR] InnoDB: Foreign key name:test/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx is too long, for the table:child. Please ALTER the foreign key name to use less than 64 characters and try upgrade again.

 [ERROR] Error in fixing SE data for test.child
 [ERROR] Failed to Populate DD tables.
 [ERROR] Aborting

How to repeat:
In 5.7 create this:

CREATE DATABASE IF NOT EXISTS test;
use test;
CREATE TABLE parent (
    id INT NOT NULL,
    PRIMARY KEY (id)
) ENGINE=INNODB;

CREATE TABLE child (
    id INT,
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx INT,
    INDEX par_ind (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx),
    CONSTRAINT `xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx` FOREIGN KEY (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)
        REFERENCES parent(id)
        ON DELETE CASCADE
) ENGINE=INNODB;

Now shutdown and start 8.0.3. Fails to startup.
[16 Nov 2017 15:07] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 8.0.4 release, and here's the changelog entry:

 A table with a 64 character foreign key name caused an upgrade failure.
Foreign key names up to 64 characters in length should be permitted.