diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2011-02-14 20:00:25 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2011-02-14 20:00:25 +0000 |
commit | dbefb6bc9c675e7b155c171ef88a1a5fc97f40b7 (patch) | |
tree | e75a0cd8c18463a2dbe7a135a8527e9e1a68a6e4 /src | |
parent | f8b7288dce60a15136583483b533eb9a7c101b64 (diff) |
Merged revision 1070625 from trunk:
_all_docs rows must not deleted include documents
After COUCHDB-1061, when POSTing to _all_docs?include_docs=true with
the body "keys" option, deleted documents were part part of the output.
The "doc" property of each _all_docs row should have the value 'null'
for all deleted documents (when ?include_docs=true).
A test was added to help prevent this from happening again.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1070631 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/couchdb/couch_httpd_db.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl index 9aa91277..82e9b989 100644 --- a/src/couchdb/couch_httpd_db.erl +++ b/src/couchdb/couch_httpd_db.erl @@ -559,7 +559,12 @@ all_docs_send_json_view_row(Resp, Db, KV, IncludeDocs, RowFront) -> all_docs_view_row_obj(_Db, {{DocId, error}, Value}, _IncludeDocs) -> {[{key, DocId}, {error, Value}]}; all_docs_view_row_obj(Db, {_KeyDocId, DocInfo}, true) -> - {all_docs_row(DocInfo) ++ couch_httpd_view:doc_member(Db, DocInfo)}; + case DocInfo of + #doc_info{revs = [#rev_info{deleted = true} | _]} -> + {all_docs_row(DocInfo) ++ [{doc, null}]}; + _ -> + {all_docs_row(DocInfo) ++ couch_httpd_view:doc_member(Db, DocInfo)} + end; all_docs_view_row_obj(_Db, {_KeyDocId, DocInfo}, _IncludeDocs) -> {all_docs_row(DocInfo)}. |