Skip to content

[Task] Reuse MySQL initialization SQL for OceanBase and remove the duplicate script #7521

Closed

Description

@cloudbase-ai

Problem

OceanBase in MySQL mode maintains a separate full initialization script even though it shares the MySQL SQL family. Every schema, seed-data and plugin migration change has to be applied twice. The copies have already drifted, so keeping both independently maintained files increases maintenance cost and permits inconsistent fresh installations.

Evidence

Inspected master at 3116109d42f4e6ca0e71258e15ec5ed051bdc4a1:

  • MySQL initialization and OceanBase initialization are not identical. For example, MySQL contains the appended namespace/lookup secondary indexes such as idx_selector_ns_plugin_name, while the OceanBase copy does not. Seed permissions and loggingKafka configuration also differ.
  • MapperConfig.OceanBaseSQLConfig already registers OceanBase with the MySQL pagination dialect. This supports consolidating the initialization source, but does not prove that every MySQL statement is accepted by every OceanBase version.
  • .github/scripts/native-sql-matrix.py currently selects db/init/ob/schema.sql for the native OceanBase job.

Requested Change

  • Use db/init/mysql/schema.sql as the canonical initialization source for both MySQL and OceanBase in MySQL mode.
  • Reconcile existing schema, index, constraint and seed-data differences before switching. Separate accidental drift from demonstrated engine-specific requirements; preserve intended features and permissions.
  • Delete the independently maintained db/init/ob/schema.sql after updating the native SQL runner and all deployment, packaging and documentation references. If a proven OceanBase-specific difference remains, maintain only a small explicit compatibility overlay rather than another full schema copy.
  • Preserve the OceanBase database configuration, JDBC driver and native CI job. This task removes duplicate SQL ownership, not OceanBase support or support for OceanBase's separate Oracle mode.
  • Keep historical upgrade scripts intact; consolidate upgrade sources only in a separately validated follow-up.

Acceptance Criteria

  • Native MySQL and OceanBase jobs initialize from the same canonical source (plus any documented minimal overlay), and both pass on the versions supported by CI.
  • Fresh installations have equivalent intended tables, indexes, constraints and plugin/resource/permission/default-namespace seed semantics, with no orphan relations or duplicate handle natural keys.
  • No independently maintained OceanBase full initialization copy or dangling reference remains. Users can still select OceanBase and locate the correct initialization instructions.

Activity

  1. github-actions commented on Oct 9, 2026

    @github-actions
    Contributor

    👋 Hello @Aias00

    A new issue has been opened by @cloudbase-ai:

    Please review when you have time. Thank you! 🙏

  2. yangjj-iso commented on Oct 11, 2026

    @yangjj-iso
    Contributor

    /assign

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions