Skip to content

Commit

Permalink
CCBC-1187: lcb_respexists_is_found returns true for deleted documents.
Browse files Browse the repository at this point in the history
We could either add a lcb_respexists_is_deleted api, or just have
is_found return false if the doc's deleted flag is set.  I chose
the latter.

Change-Id: I9feb5e86257f4f953fb0665c22df498ff05f3054
Reviewed-on: http://review.couchbase.org/c/libcouchbase/+/127443
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Build Bot <build@couchbase.com>
  • Loading branch information
davidkelly authored and avsej committed May 6, 2020
1 parent 7bdc23f commit 207d15d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/operations/exists.cc
Expand Up @@ -26,7 +26,7 @@ LIBCOUCHBASE_API lcb_STATUS lcb_respexists_status(const lcb_RESPEXISTS *resp)

LIBCOUCHBASE_API int lcb_respexists_is_found(const lcb_RESPEXISTS *resp)
{
return resp->ctx.rc == LCB_SUCCESS;
return resp->ctx.rc == LCB_SUCCESS && !resp->deleted;
}

LIBCOUCHBASE_API lcb_STATUS lcb_respexists_error_context(const lcb_RESPEXISTS *resp,
Expand Down

0 comments on commit 207d15d

Please sign in to comment.