Repository navigation
Backport #37181 to 2.0: keep the entity_extension.extension charset when widening it in 2.0.3 - #37182
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved🔴 High risk · The MySQL schema migration dynamically alters entity_extension.extension; malformed or failed DDL could leave upgrades incomplete or block writes. Backports the 2.0.3 MySQL migration fix so widening VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Fixes #37167
Backport of PR #37181 to
2.0. Same change: the 2.0.3 MySQL migration only widensentity_extension.extensiontoVARCHAR(512)and keeps the column's current character set and collation, so MySQL no longer copies the whole table. Databases that already ran the old statement are left alone here and handled in #37180.Why keeping
utf8mb4is safeThe
asciicharacter set was there to keepextensionusable in the table's primary key,(id, extension). That isn't needed:utf8mb4, MySQL counts 4 bytes per character, so the primary key needs 36 × 4 + 512 × 4 = 2192 bytes.COMPACTrow format. A database could only have created it with theDYNAMICrow format (MySQL's default since 5.7), whose limit is 3072 bytes.VARCHARstores the actual bytes, and a plain ASCII character takes 1 byte inutf8mb4too, so the hashed keys take the same space either way.The upgrade tests below widen a
utf8mb4column that is part of the primary key without errors. PR #37181 also has the same check on 300k rows.Tests
This exact file was tested inside a 2.0.7 release image with the real migration runner on MySQL 8.0:
validatevarchar(512)ascii_binvarchar(512)utf8mb4_0900_ai_ciascii) to 2.0.7 with this fixvarchar(512)ascii_bin, unchangedSee PR #37181 for the full description and the per-state SQL tests.