Repository navigation
Fix: oci8 oracle pagination backward compatibility - #10677
joshuadave143 wants to merge 2 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Hi there, @joshuadave143! 👋 It looks like this pull request does not follow our template:
Please update the description to follow the template. The Hi there, @joshuadave143! 👋 Thank you for sending this PR! We expect the following in all Pull Requests (PRs).
Important We expect all code changes or bug-fixes to be accompanied by one or more tests added to our test suite to prove the code works. If pull requests do not comply with the above, they will likely be closed. Since we are a team of volunteers, we don't have any more time to work See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md |
|
https://www.codeigniter.com/user_guide/intro/requirements.html#supported-databases Oracle 11g is below CodeIgniter's documented minimum requirement of Oracle Database 12.1, which has applied since the OCI8 driver was introduced. Oracle's Extended Support for even the final 11g release ended in December 2020, before the driver's first release in CodeIgniter 4.2.0. We do not plan to restore compatibility with Oracle 11g. Applications using it will need to upgrade their database to a version supported by CodeIgniter. The legacy pagination fallback happened to work in some cases, but Oracle 11g was never part of the driver's supported compatibility range. |
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