cloudbase-ai opened a new issue, #7521:
URL: https://github.com/apache/shenyu/issues/7521

   ## 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](https://github.com/apache/shenyu/blob/3116109d42f4e6ca0e71258e15ec5ed051bdc4a1/db/init/mysql/schema.sql)
 and [OceanBase 
initialization](https://github.com/apache/shenyu/blob/3116109d42f4e6ca0e71258e15ec5ed051bdc4a1/db/init/ob/schema.sql)
 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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to