You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2017/03/01 16:37:54 UTC

[20/43] couch-mrview commit: updated refs/heads/2971-count-distinct to f7c3c24

Introduce reset_vacc

COUCHDB-3060


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/commit/0db83c4c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/tree/0db83c4c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/diff/0db83c4c

Branch: refs/heads/2971-count-distinct
Commit: 0db83c4c8ce9819c00975f0a024e246bf4e3bd6f
Parents: e9e84c5
Author: Robert Newson <rn...@apache.org>
Authored: Thu Aug 25 16:01:25 2016 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Thu Aug 25 16:01:26 2016 +0100

----------------------------------------------------------------------
 src/couch_mrview_http.erl | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/0db83c4c/src/couch_mrview_http.erl
----------------------------------------------------------------------
diff --git a/src/couch_mrview_http.erl b/src/couch_mrview_http.erl
index 529d208..253ee30 100644
--- a/src/couch_mrview_http.erl
+++ b/src/couch_mrview_http.erl
@@ -309,7 +309,7 @@ multi_query_view(Req, Db, DDoc, ViewName, Queries) ->
         VAcc1 = VAcc0#vacc{resp=Resp0},
         VAcc2 = lists:foldl(fun(Args, Acc0) ->
             {ok, Acc1} = couch_mrview:query_view(Db, DDoc, ViewName, Args, fun view_cb/2, Acc0),
-            Acc1
+            reset_vacc(Acc1)
         end, VAcc1, ArgQueries),
         {ok, Resp1} = chttpd:send_delayed_chunk(VAcc2#vacc.resp, "\r\n]}"),
         {ok, Resp2} = chttpd:end_delayed_json_response(Resp1),
@@ -320,6 +320,10 @@ multi_query_view(Req, Db, DDoc, ViewName, Queries) ->
         _ -> {ok, Resp2}
     end.
 
+%% reset between queries in multi-query
+reset_vacc(Vacc) ->
+    Vacc#vacc{row_sent=false}.
+
 
 filtered_view_cb({row, Row0}, Acc) ->
   Row1 = lists:map(fun({doc, null}) ->