diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2011-08-13 22:10:00 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2011-08-13 22:10:00 +0000 |
commit | 2eb62337efc1171d1ea1e4392f8cacf0dabc1ab0 (patch) | |
tree | 908dc32a78b1c746a97d5528101eb7979520046b /src/couchdb | |
parent | f269c49f1d1172fc390f6d54bb79d4841f15adee (diff) |
Merge revision 1157428 from trunk
Doc validation functions from deleted ddocs must be ignored
If a design document is deleted by updating it with a "_deleted"
field set to the boolean value true, its validate_doc_update function
should be ignored for subsequent document insertions/updates.
This closes COUCHDB-1227.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1157429 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r-- | src/couchdb/couch_db.erl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl index 3a12e738..f919c72c 100644 --- a/src/couchdb/couch_db.erl +++ b/src/couchdb/couch_db.erl @@ -273,7 +273,9 @@ get_db_info(Db) -> get_design_docs(#db{fulldocinfo_by_id_btree=Btree}=Db) -> {ok, _, Docs} = couch_view:fold( #view{btree=Btree}, - fun(#full_doc_info{id= <<"_design/",_/binary>>}=FullDocInfo, _Reds, AccDocs) -> + fun(#full_doc_info{deleted = true}, _Reds, AccDocs) -> + {ok, AccDocs}; + (#full_doc_info{id= <<"_design/",_/binary>>}=FullDocInfo, _Reds, AccDocs) -> {ok, Doc} = couch_db:open_doc_int(Db, FullDocInfo, []), {ok, [Doc | AccDocs]}; (_, _Reds, AccDocs) -> |