Repository navigation
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 containedJOIN ... 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,
SYSDATEarithmetic and other Oracle operators were not lowered insideIN,BETWEEN,NOTand analytic functions. For exampleWHERE sal/3 IN (SELECT sal/3 ...)returned no rows, andSUM(n1/2) OVER ()used integer division. MOD,CEIL,REPLACE,TRANSLATEandUPPERwere 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 USINGandINSERT VALUESwere skipped by every rule; they are now lowered like any query block. N''became the identifierNNULL; it is nowNULL.- A
TIMESTAMPliteral 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 ANSILEFT JOINis still accepted. Any other(+)in an ANSIONcondition is rejected withOUTER_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 withSCALAR_CONTEXT. - Known limitation:
REPLACE(column, ...)andMOD(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
orafit-jdbc-1.0.3.jar— JDBC driver and offline analyzer. pgJDBC is not bundled; provide it in your application.orafit-jdbc-1.0.3-runtime.tar.gz— SQL runtime:native/for self-managed PostgreSQL,plain/for managed services.SHA256SUMS— SHA-256 checksums for the two files above.
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