From 17f526b45e79efd877b21ded5d4c1c31cf2d5f7a Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Thu, 27 Aug 2009 19:26:35 +0000 Subject: send deleted docs to _changes filters git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@808574 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/changes.js | 9 +++++++++ src/couchdb/couch_httpd_db.erl | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/share/www/script/test/changes.js b/share/www/script/test/changes.js index e7721cbb..1adfaa1b 100644 --- a/share/www/script/test/changes.js +++ b/share/www/script/test/changes.js @@ -189,6 +189,15 @@ couchTests.changes = function(debug) { resp = JSON.parse(req.responseText); T(resp.results.length == 1); + // changes get all_docs style with deleted docs + var doc = {a:1}; + db.save(doc); + db.deleteDoc(doc); + var req = CouchDB.request("GET", + "/test_suite_db/_changes?filter=changes_filter/bop&style=all_docs"); + var resp = JSON.parse(req.responseText); + TEquals(1, resp.results.length, "should return one result row"); + // test for userCtx run_on_modified_server( [{section: "httpd", diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl index ae58be2b..8bcacfdc 100644 --- a/src/couchdb/couch_httpd_db.erl +++ b/src/couchdb/couch_httpd_db.erl @@ -194,7 +194,7 @@ make_filter_funs(Req, Db) -> FilterSrc = couch_util:get_nested_json_value({Props}, [<<"filters">>, FName]), {ok, Pid} = couch_query_servers:start_filter(Lang, FilterSrc), FilterFun = fun(DInfo = #doc_info{revs=[#rev_info{rev=Rev}|_]}) -> - {ok, Doc} = couch_db:open_doc(Db, DInfo), + {ok, Doc} = couch_db:open_doc(Db, DInfo, [deleted]), {ok, Pass} = couch_query_servers:filter_doc(Pid, Doc, Req, Db), case Pass of true -> -- cgit v1.2.3