fix(generator): emit ROWS keyword after OFFSET for Oracle (CR-011)#17
Merged
Merged
Conversation
…-011) Oracle's SQL:2008 pagination syntax requires 'OFFSET n ROWS' — without the ROWS keyword, Oracle raises ORA-02000. The generator's OFFSET emission was gated behind Tsql|Fabric only (from the CR-010 fix). Oracle requires the same keyword. Fix: add Dialect::Oracle to the match pattern that emits ROWS after OFFSET. Tests (tests/test_dialects.rs): - test_oracle_offset_fetch_roundtrip (identity roundtrip) - test_oracle_offset_only_rows_keyword (OFFSET without FETCH) - test_pg_to_oracle_limit_offset (PG LIMIT/OFFSET → Oracle) - test_pg_to_oracle_limit_offset_no_order_by (no ORDER BY case) Refs: PSQ-2422
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes CR-011 / PSQ-2422: Oracle generator omitted the mandatory
ROWSkeyword afterOFFSET n, causingORA-02000: missing ROWS keywordon all OFFSET-FETCH pagination queries routed through the gateway.Root cause
The CR-010 fix (v0.9.36) added
ROWSemission forTsql | Fabricbut did not include Oracle, which requires the same SQL:2008 syntax:OFFSET n ROWS FETCH FIRST m ROWS ONLY.Fix
One-line change in
src/generator/sql_generator.rs: add| Some(Dialect::Oracle)to the match pattern.Tests added (
tests/test_dialects.rs)test_oracle_offset_fetch_roundtrip— identity roundtriptest_oracle_offset_only_rows_keyword— OFFSET without FETCHtest_pg_to_oracle_limit_offset— PG LIMIT/OFFSET → Oracle OFFSET/FETCH FIRSTtest_pg_to_oracle_limit_offset_no_order_by— confirms Oracle doesn't need ORDER BY guardFull suite green (1058+ tests, 0 failures). No regressions.
Refs: PSQ-2422