Informix Error -25824: The upper limit of the fragment must be aligned to an interval fragment boundary.
Cause and resolution
The upper limit of the fragment must be aligned to an interval fragment boundary.
While altering the interval fragmentation scheme to add or attach fragments above the transition value, the upper limit of the fragment being added or attached must align at an interval fragment boundary i.e. the upper limit of the fragment must equal transition value plus a multiple of the interval value.
For example, the following alter generates an error:
CREATE TABLE employee (emp_id INTEGER, emp_name CHAR(64), ssn CHAR(12), basepay FLOAT, varpay FLOAT, dept_id SMALLINT, hire_date DATE) FRAGMENT BY RANGE(emp_id) INTERVAL(1000) STORE IN (dbs1, dbs2, dbs3) PARTITION p1 VALUES < 5000 IN dbs0, PARTITION p2 VALUES < 10000 IN dbs0;
ALTER FRAGMENT ON TABLE employee ADD PARTITION p3 VALUES < 15400;
In the above example, a fragment is being added above the transition value i.e. an interval fragment is being added. The upper limit of the fragment, 15400, is not aligned to an interval fragment boundary.
The correct usage is as follows:
ALTER FRAGMENT ON TABLE employee ADD PARTITION p3 VALUES < 16000;
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-25824 fires when ALTER FRAGMENT ... ADD/ATTACH adds a fragment above the transition
value whose upper limit isn't the transition value plus a multiple of the interval
value — per the official guidance.
- A new fragment's upper limit not equal to transition value + (interval value × N), per the official guidance — the direct, only cause.
Solutions / Resolution
- Align the new fragment's upper limit to transition value + a multiple of the interval value, per the official guidance.
Examples
A misaligned upper limit
CREATE TABLE employee (emp_id INTEGER, emp_name CHAR(64), ssn CHAR(12),
basepay FLOAT, varpay FLOAT, dept_id SMALLINT, hire_date DATE)
FRAGMENT BY RANGE(emp_id) INTERVAL(1000) STORE IN (dbs1, dbs2, dbs3)
PARTITION p1 VALUES < 5000 IN dbs0,
PARTITION p2 VALUES < 10000 IN dbs0;
ALTER FRAGMENT ON TABLE employee ADD PARTITION p3 VALUES < 15400;
-- -25824: 15400 isn't 10000 + a multiple of 1000
Corrected
ALTER FRAGMENT ON TABLE employee ADD PARTITION p3 VALUES < 16000;
Diagnostic Checks
- Check the new fragment's upper limit against transition value + (interval value × N), and adjust to the nearest valid boundary.
Related Errors / Related Topics
- -25811 — "The transition value for interval fragments must be aligned to the boundary of the interval value type." A related alignment restriction, on the transition value's own definition rather than a subsequently added fragment's upper limit.
A new interval fragment's upper limit wasn't aligned to the interval boundary — adjust it to transition value + a multiple of the interval value.