YDB_ERR_NODEEND replaces YDB_NODE_END; changes to function return values
Final Release Note
The negative symbolic constant YDB_ERR_NODEEND
replaces the symbolic constant YDB_NODE_END
. Previously, YDB_NODE_END
was a positive number, even though it was documented as being negative (the programming pattern intended is traversal through nodes until an error indicates the end, analogous to reading a file till an end-of-file error). The functions ydb_node_next_s()
, ydb_node_previous_s()
, ydb_subscript_next_s()
and ydb_subscript_previous_s()
return YDB_ERR_NODEEND
to indicate an end of the traversal and leave *ret_subs_used
and/or *ret_value
unchanged. Previously, ydb_node_next_s()
and ydb_node_previous_s()
returned YDB_OK
and set *ret_subs_used
to YDB_NODE_END
to signal the end of the traversal; and ydb_subscript_next_s()
and ydb_subscript_previous_s()
returned YDB_OK
ret_value->len_used
to zero. YottaDB regrets making a change that is not backwards compatible, but this change aims to ensure simpler and more maintainable application code into the future. [#399 (closed)]
Description
About the C symbolic constant YDB_NODE_END, the Multi-Language Programmers Guide currently says: Application code should make no assumption about this constant other than that it is negative (<0). In r1.22, it is actually a positive number. Also, since negative numbers are error codes (so an application code would read nodes or subscripts iterating through the functions ydb_node_{next,previous}_s
), the new symbolic constant is YDB_ERR_NODEEND.