$ZSTATUS reports correct actual and maximum string length following ERR_INVSTRLEN return from Simple API call
Final Release Note
$ZSTATUS reports the correct actual and maximum string length values in all cases following a YDB_ERR_INVSTRLEN error returned by a Simple API function call e.g. ydb_get_s()
. Previously, $ZSTATUS could contain a 0 string length and max length value in the INVSTRLEN. [#354 (closed)]
Description
Below are some reference files in the simpleapi test (in https://gitlab.com/YottaDB/DB/YDBTest) that illustrate the issue.
For example, the simpleapi/gvnsubsnext subtest expects the INVSTRLEN error from ydb_subscript_next_s(), but instead of "Invalid string length" showing up as 7 in the YDB-E-INVSTRLEN message text, it shows up as 0.
./simpleapi/outref/gvnsubsnext.txt:# Test of INVSTRLEN error
./simpleapi/outref/gvnsubsnext.txt:Attempting ydb_subscript_next_s() with ret_value->len_alloc=0 : Expect INVSTRLEN error
./simpleapi/outref/gvnsubsnext.txt:ydb_subscript_next_s() [159]: 150375522,(SimpleAPI),%YDB-E-INVSTRLEN, Invalid string length 0: max 0 : ret_value->len_used = 7 after call
./simpleapi/outref/gvnsubsnext.txt:Attempting ydb_subscript_next_s() with ret_value->len_alloc set to value returned in ret_value->len_used after INVSTRLEN error. Expect NO error
Below are similar examples for ydb_subscript_previous_s() and ydb_get_s().
./simpleapi/outref/gvnsubsprev.txt:# Test of INVSTRLEN error
./simpleapi/outref/gvnsubsprev.txt:Attempting ydb_subscript_previous_s() with ret_value->len_alloc=0 : Expect INVSTRLEN error
./simpleapi/outref/gvnsubsprev.txt:ydb_subscript_previous_s() [159]: 150375522,(SimpleAPI),%YDB-E-INVSTRLEN, Invalid string length 0: max 0 : ret_value->len_used = 7 after call
./simpleapi/outref/gvnsubsprev.txt:Attempting ydb_subscript_previous_s() with ret_value->len_alloc set to value returned in ret_value->len_used after INVSTRLEN error. Expect NO error
./simpleapi/outref/lvnget.txt:# Test of INVSTRLEN error
./simpleapi/outref/lvnget.txt:Attempting get with ret_value->len_alloc=0 (ret_value->len_used does not matter) : Expect INVSTRLEN error
./simpleapi/outref/lvnget.txt:ydb_get_s() [g]: 150375522,(SimpleAPI),%YDB-E-INVSTRLEN, Invalid string length 0: max 0 : ret_value->len_used = 10 after call
Draft Release Note
$ZSTATUS correctly reflects the string length and max length values in all cases an YDB_ERR_INVSTRLEN error is returned for a simpleAPI function call e.g. ydb_get_s(). Previously, $ZSTATUS could contain a 0 string length and max length value in the INVSTRLEN making it less user-friendly.