Skip to content

Support parsing Oracle RMAN CHANGE SQL - #39581

Merged
terrymanu merged 1 commit into
apache:masterfrom
terrymanu:dev
Aug 23, 2026
Merged

Support parsing Oracle RMAN CHANGE SQL#39581
terrymanu merged 1 commit into
apache:masterfrom
terrymanu:dev

Conversation

@terrymanu

Copy link
Copy Markdown
Member
  • Add CHANGE BACKUPSET / DATAFILECOPY / COPY OF ARCHIVELOG SEQUENCE BETWEEN / BACKUP OF SPFILE TAG statements with AVAILABLE / UNAVAILABLE / NOKEEP qualifiers to the Oracle DAL grammar
  • Define BACKUPSET, DATAFILECOPY, AVAILABLE, UNAVAILABLE and TAG lexer tokens and register them in unreservedWord to keep identifier compatibility
  • Add OracleChangeStatement, visitor mapping and CHANGE visitor rule
  • Add 8 CHANGE parser IT cases and a BINARY_FLOAT / BINARY_DOUBLE create-table case

Fixes #27016

* Add CHANGE BACKUPSET / DATAFILECOPY / COPY OF ARCHIVELOG SEQUENCE BETWEEN /
  BACKUP OF SPFILE TAG statements with AVAILABLE / UNAVAILABLE / NOKEEP
  qualifiers to the Oracle DAL grammar
* Define BACKUPSET, DATAFILECOPY, AVAILABLE, UNAVAILABLE and TAG lexer tokens
  and register them in unreservedWord to keep identifier compatibility
* Add OracleChangeStatement, visitor mapping and CHANGE visitor rule
* Add 8 CHANGE parser IT cases and a BINARY_FLOAT / BINARY_DOUBLE create-table case

Fixes apache#27016
@terrymanu

Copy link
Copy Markdown
Member Author

Result

Review Result: Mergeable

The change implements and verifies the remaining RMAN CHANGE statement parsing from issue #27016 (4 forms × AVAILABLE/UNAVAILABLE/NOKEEP) plus the BINARY_FLOAT/BINARY_DOUBLE test cases, covering grammar, routing, statement model, and IT pipeline in line with the existing list/report precedent; no candidate passed the Finding Proof Gate as a blocking issue. The conclusion covers code scope only; CI was not reviewed.

Evidence

  • Candidate scope aligned: local HEAD (ca5ddbb) equals the PR head; the local triple-dot file list matches GitHub /pulls/39581/files file by file (15 files, +219/-1). The work tree is clean except for unrelated untracked cache directories.
  • Behavior cluster 1 (grammar acceptance): parser/sql/engine/dialect/oracle/src/main/antlr4/imports/oracle/DALStatement.g4:207 adds the change/changeOption rules covering all 8 example statements of the issue; OracleStatement.g4:169 hooks it into the execute alternative. All 8/8 examples verified parsing.
  • Behavior cluster 2 (lexer compatibility): OracleKeyword.g4 adds 5 tokens and registers them in unreservedWord at BaseRule.g4:85; identifier usages such as SELECT tag/available/unavailable/datafilecopy FROM t verified working. BACKUPSET was previously a phantom token (referenced by fileType at BaseRule.g4:855 with no lexer rule); this PR makes it matchable, which only widens accepted input, and the identifier fallback path stays intact.
  • Behavior cluster 3 (routing and model): SQLVisitorRule.java:888 adds CHANGE("Change", DAL). Cross-dialect collision ruled out: dispatch uses the root-context simple name, and Oracle's root grammar is the only one in the repo with a | change top-level alternative; MySQL/Doris CHANGE statements route via the ChangeMasterTo context with its own entry CHANGE_MASTER (SQLVisitorRule.java:636) and are unaffected.
  • Behavior cluster 4 (tests): 8 cases in test/it/parser/src/main/resources/sql/supported/dal/change.xml, expected results in case/dal/change.xml, JAXB registration (RootSQLParserTestCases.java), and assert dispatch (OracleDALStatementAssert.java) are fully wired; the classification assertion takes effect via instanceof dispatch. At identical content, InternalOracleParserIT passed 1937/1937 (exit=0, zero regression on 1928 existing cases), parser/sql/engine/core module tests passed (exit=0, including SQLVisitorRuleTest), and spotless/checkstyle passed (exit=0).
  • Dialect family check: Oracle is a trunk with no branch dialects; MySQL/Doris/PostgreSQL grammar files are untouched with no shared change surface.

Coverage

  • Reviewed head: ca5ddbb00aac99167422184a3f641a892610fa96 (base 53f8ce5d, master); all 15 authoritative files mapped to 4 behavior clusters, no churn-only files.
  • All three discovery lenses completed (root cause and behavior, blast radius and contracts, tests and runtime); the convergence pass produced no new candidates. Official syntax basis is the Oracle 19c RMAN CHANGE reference (maintSpec/keepOffset family), with each of the 8 examples validated as a legal form. The repo keeps no Oracle DAL supported-statement list, consistent with the list/report precedent, so no documentation gap exists.
  • Intentional minimal scope (not a gap): only the issue's 8 example forms are implemented; the wider RMAN surface (KEEP [FOREVER], UNCATALOG, CHANGE BACKUP TAG without SPFILE, other ARCHIVELOG qualifier forms) is not covered; the test TAG uses a single-quoted literal while the double-quoted form is grammar-supported but has no case.
  • Scope note for the author: the PR description says "Fixes Support parsing Oracle BINARY_DOUBLE BINARY_FLOAT sql #27016", so merging will auto-close the issue while its listed item 23 (MODEL-clause CASE WHEN ... IS PRESENT) remains unsupported (that form is valid Oracle syntax only inside MODEL RULES and is arguably ignorable under the issue's own "ignore incorrect syntax" instruction, but an explicit decision is worth making before closure). The two CHARACTER SET ANY_CS items are Oracle doc BNF placeholders, not literal SQL, and are likewise not implemented.
  • CI not reviewed (Code Correctness Review scope); no other unresolved evidence gaps.

@terrymanu
terrymanu merged commit 3eefbf7 into apache:master Aug 23, 2026
76 checks passed
@terrymanu
terrymanu deleted the dev branch August 23, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support parsing Oracle BINARY_DOUBLE BINARY_FLOAT sql

2 participants