Bug #95921 Prefix index length ignored while upgrading partitioned tables.
Submitted: 21 Jun 2019 11:33 Modified: 26 Nov 2019 3:49
Reporter: Sivert Sørumgård Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Enterprise Backup Documentation Severity:S3 (Non-critical)
Version:8.0.17 OS:Any
Assigned to: CPU Architecture:Any

[21 Jun 2019 11:33] Sivert Sørumgård
Description:
Followup after bug#29712110.

See also bug#29941932.

During upgrade from 5.7 to 8.0, the prefix part of a primary key used by the partitioning function is taken into account, but the prefix length is ignored, and the full column length is used instead. Hence, the table might incorrectly be rejected from being upgraded because its partition field length is found to be to large, e.g. for a table like the following:

CREATE TABLE t1(a VARCHAR(10000),
                b VARCHAR(10),
                PRIMARY KEY(a(100), b)
) PARTITION BY KEY() PARTITIONS 2;

According to support, use of prefix keys in this way is not common.

How to repeat:
Create the table above in 5.7 and attempt upgrade to 8.0.
[26 Nov 2019 3:49] Paul DuBois
Posted by developer:
 
Fixed in 8.0.19.

During upgrade of partitioned tables from MySQL 5.7 to 8.0, when a
prefix key was used by the partitioning function, the prefix length
was ignored, and the full column length was considered instead.
Consequently, the table might incorrectly be rejected from being
upgraded because its partition field length was found to be too
large.