diff options
author | Damien F. Katz <damien@apache.org> | 2008-10-21 18:43:42 +0000 |
---|---|---|
committer | Damien F. Katz <damien@apache.org> | 2008-10-21 18:43:42 +0000 |
commit | 6c9891e4f33e980f3cbe6a0e509c3ba84b692d3e (patch) | |
tree | 1a2f4458068a6cd7f6398d7192980777ef9eb809 /src/couchdb/couch_httpd_view.erl | |
parent | e8b5079917c0734637e444018c304ea057ad7f32 (diff) |
Fix for COUCHDB-99. Certain Skipped KeyValue pairs weren't being assembled into final values before being reduces.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@706714 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_view.erl')
-rw-r--r-- | src/couchdb/couch_httpd_view.erl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/couchdb/couch_httpd_view.erl b/src/couchdb/couch_httpd_view.erl index d281b82b..f01427a9 100644 --- a/src/couchdb/couch_httpd_view.erl +++ b/src/couchdb/couch_httpd_view.erl @@ -370,7 +370,6 @@ make_view_fold_fun(Req, QueryArgs, Db, TotalViewCount, ReduceCountFun) -> fun({{Key, DocId}, Value}, OffsetReds, {AccCount, AccSkip, Resp, AccRevRows}) -> - Offset = ReduceCountFun(OffsetReds), % I think we only need this call once per view PassedEnd = PassedEndFun(Key, DocId), case {PassedEnd, AccCount, AccSkip, Resp} of {true, _, _, _} -> @@ -383,6 +382,8 @@ make_view_fold_fun(Req, QueryArgs, Db, TotalViewCount, ReduceCountFun) -> {ok, {AccCount, AccSkip - 1, Resp, AccRevRows}}; {_, _, _, undefined} -> {ok, Resp2} = start_json_response(Req, 200), + io:format("OffsetReds:~p~n", [OffsetReds]), + Offset = ReduceCountFun(OffsetReds), JsonBegin = io_lib:format("{\"total_rows\":~w,\"offset\":~w,\"rows\":[\r\n", [TotalViewCount, Offset]), JsonObj = view_row_obj(Db, {{Key, DocId}, Value}, IncludeDocs), |