Feature #12025
REPOSITION-FORWARD and REPOSITION-BACKWARD error handling
Start date:
Due date:
% Done:
0%
billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:
History
#1 Updated by Greg Shah 15 days ago
REPOSITION-FORWARD and REPOSITION-BACKWARD error handling¶
Project: Database
Problem¶
The query methods REPOSITION-FORWARD() and REPOSITION-BACKWARD() are marked Full for conversion and Partial at runtime, with the reason "error reporting is not complete".
QueryWrapper.queryForward(NumberType) and queryBackward(NumberType) (persist/QueryWrapper.java, around lines 4837-4894):
- An unknown row count returns
falseunder// TODO: what error should be shown?. No error or warning is raised. - The calls to
forward()andbackward()are wrapped incatch (ErrorConditionException exc) { return logical.of(false); }. So the conditions raised bycanReposition()are swallowed: 3163 (static query not opened), 7315 (dynamic query not opened) and 3164 (query not defined asSCROLLING). WithoutNO-ERRORno message appears, and underROUTINE-LEVELorBLOCK-LEVEL ON ERROR UNDO, THROWnothing is thrown.
#10277 removed exactly this pattern from queryReposition and queryRepositionByID (REPOSITION-TO-ROW and REPOSITION-TO-ROWID), but did not change the forward and backward methods. The equivalent methods on the null-delegate implementation (around lines 9696-9750) also just return false.
Work¶
- Apply the #10277 approach to
queryForwardandqueryBackward: callcanReposition()and let its errors propagate, instead of catchingErrorConditionException. - Establish on OpenEdge what an unknown row count, a negative row count and zero do, and implement it.
- Check the null-delegate versions of both methods.
- Establish on OpenEdge whether a static query that is not declared
SCROLLINGbut is opened withQUERY-PREPARE/QUERY-OPENthrough its handle counts as forward-only for these methods, and make FWD match. - Check the
REPOSITION query-name FORWARDS/BACKWARDSstatement forms as well as the methods. - Update the gap marking for both methods.
Testcases¶
Each with an OpenEdge baseline, with and withoutNO-ERROR, and inside a block with UNDO, THROW:
- repositioning a static and a dynamic query that is not open;
- repositioning a query that is not
SCROLLING; - an unknown, negative and zero row count;
- moving past the beginning and past the end of the result list, and the result of a following
GET-NEXT/GET-PREV; - the return value of the method in each case.
#2 Updated by Alexandru Lungu 14 days ago
- Assignee set to Alexandru Lungu