Skip to content

Releases

v1.0.3

Choose a tag to compare

@github-actions github-actions released this 14 Nov 15:48

Fixes silently wrong results where Oracle operators were not lowered or (+) was dropped.

Three defects changed results without an error, plus three related gaps found while fixing them. Statements that cannot be lowered safely are now rejected.

Changes

Fixed

  • (+) was removed lexically whenever the preceding text contained JOIN ... ON, including inside literals and earlier subqueries, turning an outer join into an inner join. The marker is now handled on the parsed tree only.
  • Division, concatenation, SYSDATE arithmetic and other Oracle operators were not lowered inside IN, BETWEEN, NOT and analytic functions. For example WHERE sal/3 IN (SELECT sal/3 ...) returned no rows, and SUM(n1/2) OVER () used integer division.
  • MOD, CEIL, REPLACE, TRANSLATE and UPPER were lowered only when something else sent the statement to the parser. They are now always lowered (REPLACE(s, 'a', '') returned NULL for every row).
  • Subqueries inside UPDATE SET, UPDATE/DELETE WHERE, MERGE USING and INSERT VALUES were skipped by every rule; they are now lowered like any query block.
  • N'' became the identifier NNULL; it is now NULL.
  • A TIMESTAMP literal with more than six fractional digits could bypass its rejection when nothing else needed the parser.

Compatibility impact

  • A redundant (+) on the optional relation of an ANSI LEFT JOIN is still accepted. Any other (+) in an ANSI ON condition is rejected with OUTER_JOIN_MIXED (Oracle returns ORA-01468 for a marker on the mandatory side).
  • A statement with an Oracle operator under an expression node the rules do not handle (for example COLLATE) is rejected with SCALAR_CONTEXT.
  • Known limitation: REPLACE(column, ...) and MOD(column, ...) in a select list return Oracle's rows, but the JDBC metadata precision differs.

Verification

532 differential tests against Oracle 18c XE 18.4.0.0.0 and 724 Maven tests, all passing, including 16 new cases.

Downloads

Also on Maven Central: io.github.ltslab:orafit-jdbc:1.0.3

Install / Upgrade

Replace the driver JAR. No runtime reinstall is needed. Re-run the analyzer over your SQL: statements that were silently mistranslated may now be rejected.

Full Changelog: v1.0.2...v1.0.3

v1.0.2

Choose a tag to compare

@github-actions github-actions released this 11 Nov 17:23
84a7232

Fixes three cases where CHAR data in UNION branches or CAST was wrongly rejected or padded wrongly.

All three fixes concern fixed-width CHAR handling. There are no SQL runtime changes.

Changes

Fixed

  • A FROM subquery no longer sees sibling derived tables. A column name shared with a preceding derived table used to match twice and become unresolved, which made a UNION branch fail with SET_CHAR_WIDTH.
  • NVL(CHAR column, literal) in a UNION branch is accepted. Oracle types it as VARCHAR2 with the larger of its two argument widths; blank padding is kept on the first argument. An unprovable width is still rejected.
  • CAST(x AS CHAR(n CHAR)) now uses character semantics (CAST('É' AS CHAR(2 CHAR)) returns 'É ' as in Oracle).

Changed

  • The documentation site is deployed only when docs/ changes.

Compatibility impact

  • CHAR(n CHAR) anywhere other than directly after AS, for example in DDL, is rejected with CHAR_LENGTH_SEMANTICS instead of being treated as bytes.
  • Statements that previously failed with SET_CHAR_WIDTH for the two cases above now translate.

Verification

516 differential tests against Oracle 18c XE 18.4.0.0.0 and 694 Maven tests, all passing.

Downloads

Also on Maven Central: io.github.ltslab:orafit-jdbc:1.0.2

Install / Upgrade

Replace the driver JAR. No runtime reinstall is needed.

Full Changelog: v1.0.1...v1.0.2

v1.0.1

Choose a tag to compare

@github-actions github-actions released this 10 Nov 01:15
8c06c0b

JSqlParser is now a regular dependency instead of being shaded into the JAR, and CHAR widths in UNION branches are resolved from the database.

This release removes a class-path clash risk, widens set-operation support for physical CHAR(n) columns, and updates the pgJDBC version Orafit is tested against.

Changes

Changed

  • JSqlParser is declared as com.github.jsqlparser:jsqlparser:5.4 instead of being shaded. The shaded copy was not relocated, so its net.sf.jsqlparser classes could clash with another JSqlParser on the application class path.
  • The JAR no longer has a Main-Class. Run the analyzer with java -cp orafit-jdbc-1.0.1.jar:<jsqlparser-jar> io.github.orafit.tools.CompatibilityAnalyzer.

Fixed

  • UNION / UNION ALL branches that project physical CHAR(n) columns were rejected with SET_CHAR_WIDTH. Widths are now read from PostgreSQL column metadata and Oracle's set datatype rule is applied: equal widths stay CHAR(n); otherwise the result is VARCHAR2 of the largest width, with blank padding and duplicate elimination matching Oracle, and JDBC metadata reports the width. Branches whose width cannot be proven are still rejected.

Dependencies

  • Tested against pgJDBC 42.7.14, which fixes CVE-2026-107314 and CVE-2026-107315. pgJDBC is still not a dependency of Orafit; use 42.7.14 or later.

Compatibility impact

  • Build tools now resolve JSqlParser transitively and may pick a different version than the tested 5.4. Keep the declared version.
  • Scripts that ran java -jar orafit-jdbc-<version>.jar for the analyzer must switch to java -cp.
  • Previously rejected CHAR set-operation statements may now translate.

Verification

513 differential tests between Oracle 18c XE 18.4.0.0.0 and embedded PostgreSQL 17.10 passing, including 12 new CHAR set-width cases.

Downloads

Also on Maven Central: io.github.ltslab:orafit-jdbc:1.0.1

Install / Upgrade

Replace the driver JAR and make sure JSqlParser 5.4 is on the class path. The runtime SQL is unchanged since 1.0.0 and does not need reinstalling.

Full Changelog: v1.0.0...v1.0.1

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 02 Nov 08:09

First release: a Java 17 JDBC driver and PostgreSQL SQL runtime that absorb the Oracle SQL and JDBC differences Java applications rely on.

Orafit lets an existing Oracle-oriented Java application run on PostgreSQL through pgJDBC. It does not migrate tables or data; use a tool such as Ora2Pg for that. It is not a full Oracle emulator: SQL whose Oracle behavior cannot be reproduced reliably is rejected instead of approximated.

Features

  • JDBC driver: jdbc:orafit: URL and io.github.orafit.jdbc.OrafitDriver, delegating to pgJDBC. Bind parameters, OUT values, JDBC result metadata, update counts, vendor error codes, and transaction state are preserved.
  • SQL rewriting within the verified scope: DUAL, empty-string/NULL semantics, ROWNUM, legacy outer joins (+), LISTAGG, hierarchical queries, MERGE, RETURNING INTO.
  • SQL runtime: a native extension for self-managed PostgreSQL and a plain SQL installer for managed services such as Aurora PostgreSQL.
  • Offline analyzer: included in the JAR; scans SQL files without executing them and summarizes what is rewritten, rejected, or out of scope.

Verified coverage (representative cases):

  • Numeric: MOD, REMAINDER, SQRT, CEIL, TO_NUMBER; NUMBER division precision, rounding and overflow.
  • String: REPLACE, TRANSLATE, TO_CHAR, UPPER, RPAD, LENGTH; CHAR blank-padding comparison; mixed-type NULLIF/COALESCE datatype errors.
  • Date: DATE subtraction, TIMESTAMP to DATE truncation, TO_DATE error precedence, NEXT_DAY, TRUNC/ROUND, EXTRACT.
  • Query: fractional, NULL and negative FETCH counts; NEXTVAL repeated in one row; NEXTVAL in WHERE rejected as ORA-02287.

Scope and limitations

Each area in COMPATIBILITY.md is one of ✅ Supported, ⚠️ Supported subset, ⛔ Rejected, ➖ Out of scope. Not supported in this release: STDDEV precision, FETCH PERCENT, mixed TIMESTAMP/DATE subtraction, BYTE/Unicode/character-set-dependent functions, IGNORE NULLS, MEDIAN, PERCENTILE_CONT, KEEP (DENSE_RANK ...), RAW conversion, NLS-dependent conversion.

Item Target
Java 17 or later
Oracle baseline Oracle Database 18c XE
PostgreSQL 16 supported, 17 primary, 18 compatibility check only; 15 and older not supported
Aurora PostgreSQL 16/17 Supported through the plain SQL installer

Verification

501 differential tests between Oracle 18c XE 18.4.0.0.0 and embedded PostgreSQL 17.10, and 672 Maven tests, all passing. Within the declared scope they compare values, row order, NULLs, errors, binds/OUT values, JDBC metadata, update counts, and post-DML state.

Downloads

Also on Maven Central: io.github.ltslab:orafit-jdbc:1.0.0

Install / Upgrade

  1. Extract the runtime archive. Self-managed PostgreSQL: copy native/ to the extension directory and run CREATE EXTENSION orafit;. Managed PostgreSQL: run psql -v ON_ERROR_STOP=1 -f orafit--1.0.0.sql from plain/.
  2. Add orafit-jdbc-1.0.0.jar and pgJDBC to the classpath.
  3. Set driver=io.github.orafit.jdbc.OrafitDriver and url=jdbc:orafit://<host>:<port>/<database>.

Analyzer: java -jar orafit-jdbc-1.0.0.jar [--details] path/to/sql. License: MIT; the bundled JSqlParser is Apache-2.0 (see THIRD_PARTY_NOTICES.md).

Full Changelog: https://github.com/ltslab/orafit/commits/v1.0.0