Skip to content

Backport #37181 to 2.0: keep the entity_extension.extension charset when widening it in 2.0.3 - #37182

Merged
manerow merged 1 commit into
2.0from
fix/37167-entity-extension-widen-only-2.0
Nov 5, 2026
Merged

manerow merged 1 commit into
2.0from
fix/37167-entity-extension-widen-only-2.0

Conversation

@manerow

@manerow manerow commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #37167

Backport of PR #37181 to 2.0. Same change: the 2.0.3 MySQL migration only widens entity_extension.extension to VARCHAR(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 utf8mb4 is safe

The ascii character set was there to keep extension usable in the table's primary key, (id, extension). That isn't needed:

  • The key still fits. InnoDB allows index keys up to 3072 bytes. With utf8mb4, MySQL counts 4 bytes per character, so the primary key needs 36 × 4 + 512 × 4 = 2192 bytes.
  • Every real database already allows keys that long. Today's key is 36 × 4 + 256 × 4 = 1168 bytes, above the 767-byte limit of the old COMPACT row format. A database could only have created it with the DYNAMIC row format (MySQL's default since 5.7), whose limit is 3072 bytes.
  • No space is saved. VARCHAR stores the actual bytes, and a plain ASCII character takes 1 byte in utf8mb4 too, so the hashed keys take the same space either way.
  • Nothing changes for the app. The column keeps the character set and collation it has always had, so keys compare exactly as they did before 2.0.3, and keys with non-ASCII characters (such as older custom property names) keep working.

The upgrade tests below widen a utf8mb4 column 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:

Upgrade Column after Table rebuilt validate
2.0.2 to stock 2.0.7 (before this fix) varchar(512) ascii_bin Yes Passes
2.0.2 to 2.0.7 with this fix varchar(512) utf8mb4_0900_ai_ci No Passes
2.0.3 (old statement, column already ascii) to 2.0.7 with this fix varchar(512) ascii_bin, unchanged No Passes

See PR #37181 for the full description and the per-state SQL tests.

@manerow manerow added safe to test Add this label to run secure Github workflows on PRs backend labels Nov 5, 2026
@manerow manerow self-assigned this Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@gitar-bot

gitar-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
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 entity_extension.extension to VARCHAR(512) keeps the column's existing charset and collation, avoiding a full table rebuild. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@manerow
manerow merged commit a73f217 into 2.0 Nov 5, 2026
73 of 90 checks passed
@manerow
manerow deleted the fix/37167-entity-extension-widen-only-2.0 branch November 5, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants