fix(oceanbase): reject legacy schema collations - #1389
Open
Vanillaxi wants to merge 2 commits into
Open
Conversation
Teingi
reviewed
Aug 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue or RFC does this PR close?
Closes #1320 .
Rationale for this change
The fresh-schema fix in #1277 makes opaque identity columns use
utf8mb4_bin, but SQLAlchemy'screate_all(checkfirst=True)neither alters nor rejects tables created by earlier PowerContext versions. Therefore,upgraded deployments can start with legacyutf8mb4_general_ciidentity columns and still collapse case- or accent-variant scope and source IDs.What changes are included in this PR?
VARCHARidentity columns throughinformation_schema.COLUMNSbeforecreate_tables(),IncompatibleOceanBaseSchemaError.pc_sourcesschema withutf8mb4_general_ciand verifies that the current profile rejects it.Are there any user-facing changes?
Existing OceanBase/MySQL-mode deployments with incompatible identity-column collations now fail during Server startup .The error identifies the affected columns and directs operators to a backup, rebuild, and data-only restore procedure.
How was this change tested?
uv run pytest -q tests/builtin/persistence/test_oceanbase_profile.pytests/builtin/persistence/test_mysql_schema.py— 17 passed, 2 skippedDID NOT RAISE IncompatibleOceanBaseSchemaError; the opt-in live OceanBase case passed withPOWERCONTEXT_TEST_OCEANBASE_URL.make check— passedmake test—943 passed, 10 skippedmake docs-test— passedAI usage statement
OpenAI Codex was used to implement and review.