In testing PYCBC-1083, I have a handful of sub-document and data structure tests failing. It looks to be related to passing an empty path to sub-document array methods (an example below) in the latest LCB (I am testing against master to prep for the 3.2 release). Historically an empty path was allowed. I think there is also a create_path option, so if I need to make sure that is supplied I can make the necessary updates to documentation and the Python client. However, I think LCB might still need some updates.
Example Python snippet, works w/ LCB 3.1.4, fails w/ master.
collection.upsert("my_array", [])
|
collection.mutate_in("my_array", [SD.array_append("", "some element")])
|
# the document my_array is now ["some element"]
|
LIBCOUCHBASE_API lcb_STATUS lcb_subdocspecs_array_add_last(lcb_SUBDOCSPECS *operations, size_t index, uint32_t flags,
|
const char *path, size_t path_len, const char *value,
|
size_t value_len)
|
{
|
if (index >= operations->specs().size()) {
|
return LCB_ERR_INVALID_ARGUMENT;
|
}
|
if (path == nullptr || path_len == 0) {
|
return LCB_ERR_INVALID_ARGUMENT;
|
}
|
if (value == nullptr || value_len == 0) {
|
return LCB_ERR_INVALID_ARGUMENT;
|
}
|
auto &spec = operations->specs()[index];
|
spec.opcode(subdoc_opcode::array_add_last);
|
spec.path(std::string(path, path_len));
|
spec.value(std::string(value, value_len));
|
spec.options(flags);
|
return LCB_SUCCESS;
|
}
|