Skip to content

[Compatibility] Common MySQL collations reject Java application schema initialization #29206

Open

Description

@daviszhen

Consolidated tracking scope: C09 utf8mb3 repertoire and persisted charset identity

Original reproductions and discussions remain available in the source issues below. Administrative consolidation is not a claim that a defect is fixed. Each input family and execution path retains independent acceptance.

Included reports

  • #30800 — [Bug]: CHARACTER SET utf8 (utf8mb3) columns accept 4-byte characters MySQL rejects with 1366

Acceptance checklist


Summary

Several MySQL-compatible Java application schemas cannot initialize on MatrixOne because the parser rejects the common MySQL collation utf8mb4_unicode_ci or utf8_unicode_ci. This blocks application startup before workflow execution.

Environment

  • MatrixOne image: matrixorigin/matrixone:main-8e8e199
  • MySQL protocol: 127.0.0.1:6001
  • Server version: 8.0.30-MatrixOne-v1.3.0
  • MatrixOne source checkout used by the local cluster: ba8954d543af0bdfb1948a8b89f77f5235ac9259
  • Reproduced during the local 16-application scenario-runner validation on 2026-09-21.

Application evidence

The following unmodified upstream application schemas fail with the same MatrixOne error:

  • guns: unsupported collation utf8mb4_unicode_ci at schema line 142
  • jeecgboot: unsupported collation utf8_unicode_ci at schema line 30
  • ruoyi-vue-pro: unsupported collation utf8mb4_unicode_ci at schema line 24

The application pods remain unready; the adapter itself is healthy.

Minimal reproduction

DROP DATABASE IF EXISTS mo_collation_repro;
CREATE DATABASE mo_collation_repro;
USE mo_collation_repro;
CREATE TABLE t_collation (
  name VARCHAR(20) COLLATE utf8mb4_unicode_ci
);

Actual result:

ERROR 20301 (HY000): invalid input: unsupported collation 'utf8mb4_unicode_ci'; replace it with 'utf8mb4_general_ci' when restoring legacy MatrixOne DDL

The equivalent utf8_unicode_ci form is rejected as well.

Expected behavior

MatrixOne should accept the MySQL-compatible collation in schema DDL, or provide a documented compatibility-safe mapping/no-op when the requested collation is not materially different from the effective collation. A supported MySQL application should not be blocked during startup by this declaration.

Related

Activity

  1. added
    kind/bug
    kind/compatibility
    on Sep 21, 2026
  2. daviszhen commented on Sep 22, 2026

    @daviszhen
    ContributorAuthor

    补充 Java 应用场景证据(关联汇总 #29220):

    • jeecgboot 上游 jeecg-boot/db/jeecgboot-mysql-5.7.sql 使用 utf8_unicode_ci;适配器在导入前改写为 utf8_general_ci。
    • guns 上游 schema 使用 utf8mb4_unicode_ci;适配器改写为 MatrixOne 可接受的 collation。
    • ruoyi-vue-pro 上游 schema 使用 utf8mb4_unicode_ci;适配器同样改写。

    Before:直接执行上游 DDL 返回 unsupported collation,应用无法完成初始化。
    After:改写为 utf8_general_ci/utf8mb4_general_ci 后可以初始化,但这不是原始 MySQL DDL 的兼容性证明,且可能改变比较/排序语义。

    当前适配器配置和实现位于 mo-benchmark-java-apps/matrixone-scenario-runner/config/java_integrations.json 与 apps/java/entrypoint.sh。目标是支持原始 collation 或提供明确、语义可验证的兼容映射,随后删除适配。

  3. daviszhen commented on Sep 23, 2026

    @daviszhen
    ContributorAuthor

    Additional real-application reproduction from Grafana 12.1.1 against MatrixOne:

    • Application image: grafana/grafana:12.1.1
    • MatrixOne server: 8.0.30-MatrixOne-v1.3.0, MySQL protocol on port 6001
    • Grafana configured with GF_DATABASE_TYPE=mysql, database grafana_mo

    Grafana startup fails during its first migration with:

    Error 20301 (HY000): invalid input: unsupported collation 'utf8mb4_unicode_ci'; replace it with 'utf8mb4_general_ci' when restoring legacy MatrixOne DDL
    

    The exact failing statement is:

    CREATE TABLE IF NOT EXISTS `migration_log` (
      `id` BIGINT(20) PRIMARY KEY AUTO_INCREMENT NOT NULL,
      `migration_id` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
      `sql` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
      `success` TINYINT(1) NOT NULL,
      `error` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
      `timestamp` DATETIME NOT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;

    Grafana exits before readiness and cannot use MatrixOne as its MySQL-compatible metadata database. This confirms the existing issue also affects a current Go application migration, not only the Java applications previously reported.

  4. ck89119 commented on Sep 29, 2026

    @ck89119
    Contributor

    This issue is reused as the canonical workstream for C09 under #29479. The newly created series subtask #29488 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.

    Enable real unicode_ci and 0900 semantics only after every SQL/storage consumer is ready.

    Tracking disposition: this C-series alias is to be closed as duplicate/reused tracking in favor of #29206. The canonical issue remains responsible for the complete scope and acceptance below; closure is not a product-completion claim.

    Scope

    Acceptance criteria

    • Independent MySQL results cover ss/ß, composed/decomposed text, ignorables, U+FFFF, supplementary characters, empty/NUL and padding.
    • Equality, ordering, grouping, joins and unique indexes agree for every admitted domain.
    • Historical 0900 aliases retain their prior identity; native 0900 reports the correct ID and NO PAD.
    • The applicable [Compatibility] Common MySQL collations reject Java application schema initialization #29206 application schemas initialize and subsequent reads/writes/uniqueness work; DDL acceptance alone does not complete the task.

    Describe implementation you've considered

    Reuse #29206 and PR #29478 as the canonical implementation workstream, including the additional native-0900 integration acceptance recorded here. Backend-only evidence does not certify SQL activation.

    Additional information

  5. self-assigned this
    on Sep 29, 2026
  6. dengn commented on Oct 12, 2026

    @dengn
    Contributor

    Additional BI-client handshake evidence, independently rechecked on 2026-10-12.

    Tested server: local work binary at 23d8f61252f3017dff218b530817a240206fd762; runtime git_version() = 23d8f61252, VERSION() = 8.0.30-MatrixOne-v. Standalone LOG/TN/CN on Linux x86_64. This is not a retest of current main or a released version.

    The unsupported collation also blocks clients before schema DDL, during MySQL connection admission:

    Requested handshake collation Outcome
    utf8mb4_general_ci connects; SELECT 1 succeeds
    utf8mb4_unicode_ci error 20301: invalid input: unsupported collation 'utf8mb4_unicode_ci'
    utf8mb4_0900_ai_ci connects; SELECT 1 succeeds

    Minimal native-client reproduction (credentials supplied through environment variables):

    import os
    import pymysql
    
    for collation in (
        "utf8mb4_general_ci",
        "utf8mb4_unicode_ci",
        "utf8mb4_0900_ai_ci",
    ):
        try:
            with pymysql.connect(
                host=os.environ["MO_HOST"],
                port=int(os.environ.get("MO_PORT", "6001")),
                user=os.environ["MO_USER"],
                password=os.environ["MO_PASSWORD"],
                charset="utf8mb4",
                collation=collation,
            ) as conn:
                with conn.cursor() as cur:
                    cur.execute("SELECT 1")
                    print(collation, cur.fetchall())
        except pymysql.Error as exc:
            print(collation, exc.args)

    Real BI impact:

    • Grafana 13.1.2, official image digest sha256:b28bae15e219c998fb0e0424ed724930cc61b1f61fb404d47c862f9a23f9e572: the built-in MySQL datasource reports db query error: invalid connection. Its connection string fixes collation=utf8mb4_unicode_ci. Adding charset/collation fields to datasource JSON did not replace that fixed string.
    • Evidence @evidence-dev/[email protected]: the default mysql2 connection also fails. A diagnostic-only override of the connection charset to utf8mb4 enables SQL execution. It is not an upstream product fix, and separate connector-side DECIMAL-to-Number precision loss remains.

    This comment supplies an application/handshake regression fixture for the existing collation work, rather than opening a duplicate schema-collation issue. Related admission work: #29481; end-to-end UCA tracking: #29206 / #29479. Supporting an accepted name should preserve its actual semantics, not silently alias Unicode collation to general-ci.

  7. dengn commented on Oct 12, 2026

    @dengn
    Contributor

    Native BI/driver follow-up on 2026-10-12 UTC, pinned MO 23d8f61252f3017dff218b530817a240206fd762:

    • Official Grafana 13.2.3, bundled MySQL plugin 13.1.2, cannot establish its native MO datasource (invalid connection). Its health check and two scalar/metric queries fail; a saved 10-panel dashboard returns failures for all 10 panel requests. The same Grafana instance connects to an isolated MySQL 8.0.30 datasource and executes both positive-control queries successfully.
    • Independently using go-sql-driver/mysql v1.9.3, default collation and explicit utf8mb4_general_ci both connect to MO and return SELECT 1 = 1; explicit utf8mb4_unicode_ci, with or without charset=utf8mb4, produces unexpected EOF / invalid connection during initialization. All four configurations succeed against MySQL 8.0.30.
    • Direct SQL through an already-connected PyMySQL session confirms SET NAMES utf8mb4 COLLATE utf8mb4_general_ci succeeds, while SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci returns error 20301, unsupported collation 'utf8mb4_unicode_ci'. Subsequent SELECT 1 in that same session succeeds.

    This independently confirms the collation limitation and reproduces the connection-time failure pattern. The Go probe is a controlled companion test, not a claim that every internal Grafana handshake step was packet-traced; current HEAD was not redeployed. Saving the dashboard configuration is explicitly not counted as successful data rendering.

  8. daviszhen commented on Oct 20, 2026

    @daviszhen
    ContributorAuthor

    最新 main 验证(2026-10-20)

    基线:309f618995af4ee23e3b9149365f4af77264090d;相关 PR:#29601/#29828/#29834/#29912。

    结论:部分解决。exact-main 已验证 utf8/utf8mb4 Unicode DDL 可用,SHOW FULL COLUMNS/ information_schema.COLUMNS 返回正确 charset/collation,握手 collation ID 192/224/255 可用,planner/sysview/frontend 相关 UT 通过。

    但该 issue 的完整 UCA/application 语义(排序、分组、连接、唯一索引、真实应用 schema 等)仍未全部覆盖;尤其大小写不敏感唯一键问题仍可在 #28164 复现。因此建议继续保留为开放的完整兼容性跟踪。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/compatibilitykind/bugkind/compatibility

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions