You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug][Compatibility]: Gitea cannot initialize because ALTER DATABASE COLLATE is rejected #28998
kind/bugSomething isn't workingkind/compatibilityThe compatibility with mysql 8.0 should be discussed further.severity/s0Active / top priority for current sprint. Owner has committed to working on it now.
Gitea/Gogs applications using MatrixOne through the MySQL protocol cannot complete ORM initialization because the collation bootstrap statement is rejected by the MatrixOne parser. This is observed in the mo-scenario integration deployment; MatrixOne service-component logs are not used as the source of this report.
Environment
MatrixOne cloud endpoint exposed through the MySQL protocol on port 6001
Gitea executes the following MySQL-compatible statement during startup (database name abbreviated here):
ALTERDATABASE`gitea_mo`
CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
MatrixOne returns:
Error 1064 (42000): SQL parser error
syntax error near " CHARACTER SET utf8mb4 COLLATE utf8mb4_bin"
The same error is emitted on every ORM initialization retry. The application eventually logs InitDBEngine failed and remains unready/enters CrashLoopBackOff.
Expected behavior
Either accept the MySQL-compatible ALTER DATABASE ... CHARACTER SET ... COLLATE ... form, or provide a compatibility-safe no-op/response that allows the application migration to continue when the requested collation is already the effective collation. A supported MySQL application should not be blocked during startup by this statement.
Impact
Gitea cannot start when configured to use MatrixOne, even though the database connection itself succeeds. This blocks deployment of the application without changing its source code or adding a dialect-specific workaround.
This issue is reused as the canonical workstream for C03 under #29479. The newly created series subtask #29482 is being closed as duplicate tracking, not as completed functionality. Please retain the full additional scope and acceptance below alongside the original report. Existing open implementation PRs are references, not completion evidence.
Persist and apply defaults to subsequently created objects rather than returning a compatibility no-op.
Tracking disposition: this C-series alias is to be closed as duplicate/reused tracking in favor of #28998. The canonical issue remains responsible for the complete scope and acceptance below; closure is not a product-completion claim.
Keep SHOW CREATE, information_schema, CHARSET/COLLATION and runtime behavior consistent.
Separate changing table defaults from CONVERT TO CHARACTER SET and actual data/index conversion.
Acceptance criteria
ALTER DATABASE affects later unqualified objects but does not rewrite existing columns; explicit declarations override defaults.
New columns demonstrate inherited semantics through comparisons and indexes, not metadata alone.
Invalid combinations and new latin1 declarations fail without partial objects; conversion failure preserves original data and indexes.
Validate privileges, missing databases, tenant isolation, transaction/background contexts and restart/restore.
Describe implementation you've considered
Reuse #28998 and PR #29374, adapting their metadata to C01 and conversion policy to C02. Preserve the real inheritance contract; do not revive the no-op in #29023.
Native SQL activation also requires the applicable C11 upgrade and C12 release gates.
Shared scope: five charset families and twelve canonical collations; latin1/latin1_* are explicitly unsupported for new requests.
Exclusions: partition tables, stored procedures, UDFs, warning count/text compatibility, utf16/utf32/gb18030 and other unlisted collations.
Existing product defaults are not changed incidentally. Preserve legacy objects; do not use accepted DDL or a backend-only test as end-to-end evidence.
This issue does not itself approve a production design, an open PR, or unverified CI evidence.
Post-merge actual verification of #29374, retaining separate branch/qualification scope.
main b111224b0c624773389b390cd3cf1223126b6ee2, Linux/amd64, Go1.27.1, repository CPU/CGo wrapper:
Independent real MySQL SQL executes the reported ALTER DATABASE ... CHARACTER SET utf8mb4 COLLATE utf8mb4_bin successfully, asserts SCHEMATA utf8mb4/utf8mb4_bin, then proves a newly created column inherits utf8mb4_bin. Changing the database default afterwards leaves the existing column/data unchanged.
The independent original SQL/nearby controls pass normal AND race, using overlay-only TestAuditRound1450OriginalSQL; no production patch or assertion edits.
13 complete owner packages pass 40,594 test/subtest events, 0 failures/11 explicitly retained skips. Full SQL integration passes 54 roots/391 events, including TestDatabaseCharsetInheritanceContract, TestDatabaseDefaultsFailureAndRecovery and TestCharsetConversionPreservesExpressionSemantics.
Real two-CN normal owning package passes 15 events; selected race prepared/protocol/join consumers pass 10. Durable restart passes. Real v4.0.15 migration handler replay against restored pre-defaults schema passes system/tenant and idempotence assertions (3 events). This is handler/schema upgrade evidence, not an old-binary rolling upgrade.
Failure coverage includes invalid repertoire/unique conversion preserving source, commit failure, corrupt generation fail-closed, snapshot/PITR and cross-account remapping, prepared freshness and persisted expression semantics after restart.
Commands use mo-cgo-test, -count=1 -short -tags matrixone_test -json with bounded -p 1/2 and 12-minute guards; normal/race target ./pkg/tests/sqlintegration and mapped owners/consumers. Raw commands, actual SHAs and terminal results are preserved by the audit.
4.2-dev ac27db31696c0394ab1b2787b7b0a8f4933f088f, Go1.26.4 remains broken for the original public statement:
Error 1064 (42000): SQL parser error ... near " character set utf8mb4 collate utf8mb4_bin"
The clean old-main d00ece1 negative control independently reproduces that same parser rejection. Keep development with ck89119 and leave the issue open for this branch gap; main-only acceptance is not an all-branch completion.
Limits: the private mo-scenario Gitea deployment was not accessible/rebuilt; the exact SQL and real persistence/metadata consumers were tested instead. No GPU, live mixed/old-binary rolling upgrade, full-repository CI or complete C01-C12 collation certification. Initial local startup collisions from separate audit port registries were excluded and affected runs retried after unifying the lease directory; their original logs remain preserved.
Regression and extended verification for #28998 (2026-10-21)
Verification Environment
MatrixOne origin/main at validation time: 04fe057bd73520cdf30754f79f66f6505060ad1f — fix(frontend): publish DUMP archives with create-only storage writes (#29808). The running darwin/arm64mo-service was freshly built from that commit, and its embedded VCS revision was checked.
Local topology: 2 CN / 1 TN / 1 Log service / 1 Proxy. Proxy 6001, CN1 16001, and CN2 16002 were independently reachable over the MySQL protocol. The original SQL was executed through all three endpoints, not merely health-checked.
Clients: PyMySQL text protocol for the original SQL; Go database/sql + go-sql-driver/mysql with interpolateParams=false for real COM_STMT_PREPARE / COM_STMT_EXECUTE. An official Gitea 1.26.4-rootless instance was also started against the local Proxy.
Associated fix: MatrixOne PR #29374, commit 7c2847207dc5bd87f6c23dc7318f7be21c0a5f2a — fix(sql): persist charset defaults and implement table conversion. It is included in the tested main binary. The issue owner said a 4.2-dev backport is not required.
What Was Covered
OK — The original Gitea ALTER DATABASE ... CHARACTER SET utf8mb4 COLLATE utf8mb4_bin succeeded on Proxy 6001, CN1 16001, and CN2 16002; the reported 1064 parser error did not recur.
OK — information_schema.schemata showed the persisted utf8mb4 / utf8mb4_bin default. New columns inherited binary collation, while pre-existing columns and data retained their previous collation. MIN, MAX, and indexed equality checks confirmed runtime behavior rather than metadata alone.
OK — Explicit table override, repeated ALTER DATABASE, SQL prepared DDL, and binary-protocol prepared DDL used the expected current defaults. The binary-protocol scenario passed on all three endpoints.
OK — Negative cases included unsupported collation 20301, missing database 1049, initial privilege denial 20101, and grant/revoke rechecks. Failed conversion cases (20105 / 20301) preserved source data and indexes; valid conversion also passed.
OK — Tenant isolation was checked with the same database name in separate tenants through CN1 and CN2. Focused integration coverage passed for durable restart, snapshot/PITR and cross-account restore, plus the 4.0.15 metadata-upgrade handler. The handler test is not evidence of a live rolling upgrade.
OK — Official Gitea 1.26.4-rootless completed ORM initialization through the local Proxy, exposed a healthy /api/healthz, and created 112 tables. This is an application-level control, but it is not the private scenario image.
Not covered — Startup of the exact private scenario-runner-gitea-1.27.3 deployment; its environment was not accessible. Therefore recovery of that specific private deployment is not confirmed. The expanded C03 acceptance criteria have not received a complete, independent sign-off; unexecuted items must not be counted as passed.
The original reported bug is fixed on the tested main binary. No MatrixOne product failure was observed in the executed local SQL, protocol, application-control, or focused integration scenarios.
TKE run #39568304757 failed during baseline-cluster scheduling, before the upgrade SQL assertions. In a subsequent run, CN rollout reached the protocol gate: the old CN reported protocol version 10, while the target migration required all CNs to support at least version 61. The upgrade was rejected; the new CN then timed out while waiting to become query-ready and panicked on startup. No post-upgrade [Bug][Compatibility]: Gitea cannot initialize because ALTER DATABASE COLLATE is rejected #28998 SQL assertion ran. These are upgrade-path blockers, not evidence that the original SQL regression failed. Rerunning the same version pair unchanged would not resolve the protocol mismatch.
Large-data regression: not needed for this defect mechanism. It concerns DDL parsing, persisted defaults, and collation semantics, not row count, block/batch, spill, skew, or throughput. The Nightly case targets the upgrade boundary, not data volume.
MOTR / BVT Coverage
SQL and real binary-protocol cases are in MOTR PR #251. Source issue commit: bfb291f384365431c211053e9fa31f795362b9c6; daily cherry-pick: 9a806a901b34e30236710e8ab9e41f89497f7841.
Both cases were recorded and replayed on Proxy 6001: 2/2 cases and 27/27 statements/checks passed. The binary-protocol script also passed directly on CN1 16001 and CN2 16002; original/text checks passed on all three endpoints. The cases used isolated databases and ran with MOTR -j 2, which is case scheduling, not MatrixOne engine-parallel execution.
Nightly PR #1844, issue commit 05081e8c5af06becda70ae6e3b8012a7b3985e1b, adds a pre/post-upgrade fixture to the existing TKE workflow. Local script dry-runs and focused workflow tests passed. Live upgrade qualification did not pass: the first TKE attempt was blocked by cluster scheduling, and a later attempt was stopped by the mixed-version protocol gate before post-upgrade SQL. This PR is C11 upgrade-path evidence, not a completed [Bug][Compatibility]: Gitea cannot initialize because ALTER DATABASE COLLATE is rejected #28998 regression or a gate for the original bug's main verdict. No MatrixOne service source was changed.
Final Conclusion
Fixed for the original #28998 failure on the tested main; expanded C03 acceptance is not fully signed off. The original 1064 failure did not recur on any of the three endpoints, and the official Gitea control initialized successfully. The exact private Gitea deployment was not run, so its operational recovery cannot be claimed. Live 4.2-dev → main rolling upgrade belongs to C11 #29490; its current protocol-gate failure neither overturns the original main verdict nor establishes upgrade compatibility. The issue owner stated that a 4.2-dev backport is not required.
kind/bugSomething isn't workingkind/compatibilityThe compatibility with mysql 8.0 should be discussed further.severity/s0Active / top priority for current sprint. Owner has committed to working on it now.
Activity
ck89119 commentedon Sep 29, 2026
This issue is reused as the canonical workstream for C03 under #29479. The newly created series subtask #29482 is being closed as duplicate tracking, not as completed functionality. Please retain the full additional scope and acceptance below alongside the original report. Existing open implementation PRs are references, not completion evidence.
Persist and apply defaults to subsequently created objects rather than returning a compatibility no-op.
Tracking disposition: this C-series alias is to be closed as duplicate/reused tracking in favor of #28998. The canonical issue remains responsible for the complete scope and acceptance below; closure is not a product-completion claim.
Scope
Acceptance criteria
Describe implementation you've considered
Reuse #28998 and PR #29374, adapting their metadata to C01 and conversion policy to C02. Preserve the real inheritance contract; do not revive the no-op in #29023.
Additional information
XuPeng-SH commentedon Oct 17, 2026
Post-merge actual verification of #29374, retaining separate branch/qualification scope.
main
b111224b0c624773389b390cd3cf1223126b6ee2, Linux/amd64, Go1.27.1, repository CPU/CGo wrapper:Commands use mo-cgo-test, -count=1 -short -tags matrixone_test -json with bounded -p 1/2 and 12-minute guards; normal/race target ./pkg/tests/sqlintegration and mapped owners/consumers. Raw commands, actual SHAs and terminal results are preserved by the audit.
4.2-dev
ac27db31696c0394ab1b2787b7b0a8f4933f088f, Go1.26.4 remains broken for the original public statement:The clean old-main d00ece1 negative control independently reproduces that same parser rejection. Keep development with ck89119 and leave the issue open for this branch gap; main-only acceptance is not an all-branch completion.
Limits: the private mo-scenario Gitea deployment was not accessible/rebuilt; the exact SQL and real persistence/metadata consumers were tested instead. No GPU, live mixed/old-binary rolling upgrade, full-repository CI or complete C01-C12 collation certification. Initial local startup collisions from separate audit port registries were excluded and affected runs retried after unifying the lease directory; their original logs remain preserved.
ck89119 commentedon Oct 18, 2026
no need to backport to 4.2-dev
slyunnn commentedon Oct 21, 2026
Regression and extended verification for #28998 (2026-10-21)
Verification Environment
origin/mainat validation time:04fe057bd73520cdf30754f79f66f6505060ad1f—fix(frontend): publish DUMP archives with create-only storage writes (#29808). The runningdarwin/arm64mo-servicewas freshly built from that commit, and its embedded VCS revision was checked.2 CN / 1 TN / 1 Log service / 1 Proxy. Proxy6001, CN116001, and CN216002were independently reachable over the MySQL protocol. The original SQL was executed through all three endpoints, not merely health-checked.database/sql+go-sql-driver/mysqlwithinterpolateParams=falsefor realCOM_STMT_PREPARE/COM_STMT_EXECUTE. An official Gitea1.26.4-rootlessinstance was also started against the local Proxy.7c2847207dc5bd87f6c23dc7318f7be21c0a5f2a—fix(sql): persist charset defaults and implement table conversion. It is included in the testedmainbinary. The issue owner said a4.2-devbackport is not required.What Was Covered
ALTER DATABASE ... CHARACTER SET utf8mb4 COLLATE utf8mb4_binsucceeded on Proxy6001, CN116001, and CN216002; the reported1064parser error did not recur.information_schema.schematashowed the persistedutf8mb4/utf8mb4_bindefault. New columns inherited binary collation, while pre-existing columns and data retained their previous collation.MIN,MAX, and indexed equality checks confirmed runtime behavior rather than metadata alone.ALTER DATABASE, SQL prepared DDL, and binary-protocol prepared DDL used the expected current defaults. The binary-protocol scenario passed on all three endpoints.20301, missing database1049, initial privilege denial20101, and grant/revoke rechecks. Failed conversion cases (20105/20301) preserved source data and indexes; valid conversion also passed.4.0.15metadata-upgrade handler. The handler test is not evidence of a live rolling upgrade.1.26.4-rootlesscompleted ORM initialization through the local Proxy, exposed a healthy/api/healthz, and created112tables. This is an application-level control, but it is not the private scenario image.scenario-runner-gitea-1.27.3deployment; its environment was not accessible. Therefore recovery of that specific private deployment is not confirmed. The expanded C03 acceptance criteria have not received a complete, independent sign-off; unexecuted items must not be counted as passed.4.2-dev→mainrolling upgrade or its post-upgrade SQL assertions. This is a separate C11 upgrade-compatibility/release gate, not a prerequisite for concluding that the original [Bug][Compatibility]: Gitea cannot initialize because ALTER DATABASE COLLATE is rejected #28998 parser/bootstrap bug is fixed on the testedmain.Findings
mainbinary. No MatrixOne product failure was observed in the executed local SQL, protocol, application-control, or focused integration scenarios.10, while the target migration required all CNs to support at least version61. The upgrade was rejected; the new CN then timed out while waiting to become query-ready and panicked on startup. No post-upgrade [Bug][Compatibility]: Gitea cannot initialize because ALTER DATABASE COLLATE is rejected #28998 SQL assertion ran. These are upgrade-path blockers, not evidence that the original SQL regression failed. Rerunning the same version pair unchanged would not resolve the protocol mismatch.MOTR / BVT Coverage
bfb291f384365431c211053e9fa31f795362b9c6; daily cherry-pick:9a806a901b34e30236710e8ab9e41f89497f7841.6001:2/2cases and27/27statements/checks passed. The binary-protocol script also passed directly on CN116001and CN216002; original/text checks passed on all three endpoints. The cases used isolated databases and ran with MOTR-j 2, which is case scheduling, not MatrixOne engine-parallel execution.05081e8c5af06becda70ae6e3b8012a7b3985e1b, adds a pre/post-upgrade fixture to the existing TKE workflow. Local script dry-runs and focused workflow tests passed. Live upgrade qualification did not pass: the first TKE attempt was blocked by cluster scheduling, and a later attempt was stopped by the mixed-version protocol gate before post-upgrade SQL. This PR is C11 upgrade-path evidence, not a completed [Bug][Compatibility]: Gitea cannot initialize because ALTER DATABASE COLLATE is rejected #28998 regression or a gate for the original bug'smainverdict. No MatrixOne service source was changed.Final Conclusion
Fixed for the original #28998 failure on the tested
main; expanded C03 acceptance is not fully signed off. The original1064failure did not recur on any of the three endpoints, and the official Gitea control initialized successfully. The exact private Gitea deployment was not run, so its operational recovery cannot be claimed. Live4.2-dev→mainrolling upgrade belongs to C11 #29490; its current protocol-gate failure neither overturns the originalmainverdict nor establishes upgrade compatibility. The issue owner stated that a4.2-devbackport is not required.