Repository navigation
fix: restore OCI8 Oracle pagination backward compatibility - #10678
joshuadave143 wants to merge 2 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
0cf04f4 to
4153a74
Compare
|
TL;DR - it was working by accident. Oracle Database 12.1 has been the documented minimum since the OCI8 driver was introduced in CodeIgniter 4.2.0. This requirement was explicitly discussed in the original driver PR and included in its documentation. Although earlier releases retained a Also, the fallback was removed in 4.6.1, through #9472. That change followed the existing minimum requirement and addressed a pagination issue where version detection could incorrectly select the legacy path even on Oracle 19c, see #9469. Reintroducing this pagination fallback would still leave Oracle 11g without full driver support - for example, Forge relies on identity columns introduced in Oracle 12.1 for auto-increment support. |
Description
This PR restores backward compatibility for Oracle pagination in the OCI8 Query Builder.
In CodeIgniter 4.2.1, the OCI8 Builder checked the connected Oracle database version before generating pagination SQL. It used
OFFSET ... FETCH NEXTfor Oracle 12c and above, andROWNUM-based pagination for older Oracle versions.In CodeIgniter 4.7.5, this version-dependent handling was removed, causing the driver to always generate
OFFSET ... FETCH NEXTpagination syntax.This causes compatibility issues with older Oracle database versions, particularly Oracle 11g, which does not support this syntax.
Changes Made
_limit()method.OFFSET ... FETCH NEXTpagination for Oracle 12c and above.ROWNUM-based pagination for Oracle versions below 12c.Reason for the Change
This change prevents existing applications using older Oracle database versions from encountering SQL errors after upgrading CodeIgniter.
It also preserves the existing pagination behavior for newer Oracle database versions.
Testing
The issue was reproduced using CodeIgniter 4.7.5 with Oracle 11g.
The same query worked in CodeIgniter 4.2.1 but failed in CodeIgniter 4.7.5 with:
Testing should cover both Oracle 11g and Oracle 12c+ pagination behavior, including non-zero offsets.
Checklist: