You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2013/06/29 17:17:48 UTC

[07/50] [abbrv] git commit: updated refs/heads/1843-feature-bigcouch to cba2e81

Fix handling of initial accumulator for objects

BugzID: 14798


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

Branch: refs/heads/1843-feature-bigcouch
Commit: b82ccc54ae035e16aed1c47c99f2be04fe62df23
Parents: 98a0cfa
Author: Adam Kocoloski <ad...@cloudant.com>
Authored: Mon Dec 10 14:29:30 2012 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Wed Mar 20 06:02:51 2013 -0500

----------------------------------------------------------------------
 src/couch/src/couch_query_servers.erl | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/b82ccc54/src/couch/src/couch_query_servers.erl
----------------------------------------------------------------------
diff --git a/src/couch/src/couch_query_servers.erl b/src/couch/src/couch_query_servers.erl
index e420ce9..4e4f938 100644
--- a/src/couch/src/couch_query_servers.erl
+++ b/src/couch/src/couch_query_servers.erl
@@ -211,6 +211,8 @@ builtin_reduce(Re, [<<"_stats",_/binary>>|BuiltinReds], KVs, Acc) ->
 builtin_sum_rows(KVs) ->
     lists:foldl(fun([_Key, Value], Acc) -> sum_values(Value, Acc) end, 0, KVs).
 
+sum_values({Props}, 0) ->
+    {Props};
 sum_values({Props}, {AccProps}) ->
     {sum_objects(lists:sort(Props), lists:sort(AccProps))};
 sum_values(Value, Acc) when is_number(Value), is_number(Acc) ->