We have implemented a skeleton API that allows the user to call cursor->bound, now we should save the provided bounds into the cursor b-tree.
The cursor->set_key method will be used to allow the user to specify the given bound. An example usage looks as follows:
cursor->set_key(cursor, “A”) cursor->bound(cursor, “bound=lower”) cursor->set_key(cursor, “K”) cursor->bound(cursor, “bound=upper,inclusive=false”) cursor->set_key(cursor, “J”) cursor->search_near(cursor) cursor->reset(cursor)
This will require four new flags to be added to the CBT. The new flags will be CURSOR_BOUND_UPPER, CURSOR_BOUND_LOWER, CURSOR_BOUND_UPPER_INCL, CURSOR_BOUND_LOWER_INCL. A new #define will be added for simplification CURSOR_HAS_BOUNDS = F_ISSET(CBT, CURSOR_BOUND_UPPER | CURSOR_BOUND_LOWER).
The API should check that a key is set before applying it to the CBT as a raw key.
Scope:
- Implement the key setting and flag logic.
- Update the existing cursor bound python test to check that key setting logic works as expected.
- Clear the bounds when cursor->reset() is called. Increment a statistic when bounds are cleared via reset.
Extended scope:
- If time permits check whether the bounds are overlapping and return EINVAL. Otherwise create a follow on jira.
- is related to
-
WT-9139 Investigate range bounded cursor implementation detail
- Closed