You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "terrymanu (via GitHub)" <gi...@apache.org> on 2026/08/23 10:07:32 UTC

[PR] Support parsing Oracle CREATE SCHEMA sql from issue #27082 [shardingsphere]

terrymanu opened a new pull request, #39576:
URL: https://github.com/apache/shardingsphere/pull/39576

   Fixes #27082.
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support parsing Oracle CREATE SCHEMA sql from issue #27082 [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu merged PR #39576:
URL: https://github.com/apache/shardingsphere/pull/39576


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Support parsing Oracle CREATE SCHEMA sql from issue #27082 [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on PR #39576:
URL: https://github.com/apache/shardingsphere/pull/39576#issuecomment-5385473625

   ### Result
   
   **Review Result: Mergeable**
   
   This PR adds Oracle `CREATE SCHEMA` parsing support. The grammar matches the official Oracle documentation, reuses the shared `CreateSchemaStatement` model and existing downstream chains, and introduces no public contract changes. No candidate issue passed the blocking proof gate.
   
   ### Evidence
   
   - **Grammar correctness**: `parser/sql/engine/dialect/oracle/src/main/antlr4/imports/oracle/DDLStatement.g4:963-969` adds `createSchema : CREATE SCHEMA AUTHORIZATION schemaName createSchemaElement*` and `createSchemaElement : createTable | createView | grant`. The Oracle 19c SQL Reference (CREATE SCHEMA page) confirms: `AUTHORIZATION` is mandatory and is followed by the schema name (which must equal the username); only CREATE TABLE / CREATE VIEW / GRANT statements may appear inside, in any order and with repetition; the whole statement shares a single terminator (no semicolons on inner statements). The implementation matches this syntax element by element, and the test case `create_schema_authorization_with_elements` is the exact example from the official documentation.
   - **Dispatch and visitor**: `autogen/OracleStatement.g4:171` adds `createSchema` to the `execute` alternatives; `OracleDDLStatementVisitor.java:1058-1062` maps the identifier after `AUTHORIZATION` to `username`, consistent with the PostgreSQL visitor precedent (`AUTHORIZATION roleSpec → setUsername`).
   - **Downstream safety**: `CreateSchemaStatement` is classified as schema DDL (`TablelessRouteEngineFactory.java:97` broadcast routing, which does not read the name fields); `CreateSchemaPushDownMetaDataRefresher.java:38-40` resolves `oe` via the `schemaName → username` fallback to refresh metadata, with no null path.
   - **Dialect blast radius**: per the repository dialect table, Oracle has no branch dialects, so no sibling synchronization is required; the shared test resource changes only append entries with `db-types="Oracle"`, and the existing SQLServer/PostgreSQL/openGauss create-schema cases are untouched.
   - **Local verification (PR head `abfdc8c02ff`, aligned file-by-file with the GitHub file list)**: `InternalOracleParserIT` rerun passed (Tests run: 1923, Failures: 0, Errors: 0, exit 0); the same content previously passed the engine module unit tests, `spotless:apply`, and `checkstyle:check` (all exit 0).
   
   ### Coverage
   
   - Review basis: PR #39576 head `abfdc8c02ff` (1 commit, 7 files, +68/-0), base `e812d69d14c`; the local triple-dot file list matches GitHub `/pulls/39576/files` exactly; the PR has no comments and no review threads.
   - Behavior clusters: ① Oracle CREATE SCHEMA grammar + dispatch + visitor (3 production files); ② CREATE SCHEMA parser IT cases (2 resource files); ③ MV_CAPABILITIES_TABLE inline-comment and data-type IT case (shared create-table resources). All 7 files are mapped; there are no churn-only files.
   - All three discovery lenses (root cause and behavior / blast radius and contracts / tests, runtime, and operations) are complete; candidate issues (including superset acceptance of inner statements, the `username` mapping, shared-file regression, ANTLR alternative ambiguity, and the missing RELEASE-NOTES entry) were each examined against counter-evidence and either excluded by the proof gate or classified as non-blocking; the convergence pass produced no new independent candidates.
   - Notes (non-blocking): the create-schema expected entries follow the bare-entry assertion depth of the existing SQLServer/PostgreSQL cases in the same file, without a field-level `username` assertion; no RELEASE-NOTES entry was added, consistent with the recent Oracle parsing series (#39542–#39565).
   - Official documentation: Oracle 19c SQL Reference, CREATE SCHEMA page; dialect family: Oracle (trunk, no branch dialects); no repository docs or example updates were required.
   - This conclusion is code-scope only (Code Correctness Review); CI/Actions were not queried and were not reviewed.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org