ydb_subscript_next_s(), ydb_subscript_next_st(), ydb_subscript_previous_s(), and ydb_subscript_previous_st() return YDB_ERR_NODEEND when there is no successor / predecessor subscripted local variable node
Final Release Note
ydb_subscript_next_s()
, ydb_subscript_next_st()
, ydb_subscript_previous_s()
, and ydb_subscript_previous_st()
return YDB_ERR_NODEEND and leave *ret_value
unmodified when provided with a subscripted local variable as input, and there is no successor or predecessor node. In YottaDB r1.24, the functions could sometimes return YDB_ERR_LVUNDEF incorrectly or YDB_OK, and could set *ret_value
to the empty string. [#417 (closed)]
Description
As part of #399 (closed), ydb_subscript_next_s()/ydb_subscript_previous_s() were changed to return YDB_ERR_NODEEND in case to indicate an end of traversal (i.e. no more subscripts at that level). But this does not work reliably in the case where they are passed a subscripted local variable as input where the local variable or any nodes underneath it do not exist. It could return YDB_ERR_NODEEND or YDB_ERR_LVUNDEF or YDB_OK (in which case ret_value
would be set to the empty string).
Also #399 (closed) documents that in the YDB_ERR_NODEEND case, ret_value
is untouched. But in this case (subscripted local variable input where the local variable tree is non-existent) ret_value
is modified to point to the empty string.
Draft Release Note
ydb_subscript_next_s()/ydb_subscript_previous_s() reliably return YDB_ERR_NODEEND (and leaves ret_value
unmodified) if they are passed a subscripted local variable as input and no subscripted or unsubscripted nodes of that local variable exist. In YottaDB r1.24, this could incorrectly return YDB_ERR_LVUNDEF or YDB_OK in some cases and could set ret_value
to the empty string instead of leaving it unmodified.