couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [14/50] git commit: Fix handling of initial accumulator for objects
Date Sat, 18 Jan 2014 00:47:39 GMT
Fix handling of initial accumulator for objects

BugzID: 14798


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

Branch: refs/heads/import
Commit: e49c19eb5e83d1788eee71bbbaee68eae85c73f8
Parents: a0fb292
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Mon Dec 10 14:29:30 2012 -0500
Committer: Paul J. Davis <paul.joseph.davis@gmail.com>
Committed: Fri Jan 17 16:44:30 2014 -0800

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


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/e49c19eb/src/couch_query_servers.erl
----------------------------------------------------------------------
diff --git a/src/couch_query_servers.erl b/src/couch_query_servers.erl
index e420ce9..4e4f938 100644
--- a/src/couch_query_servers.erl
+++ b/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) ->


Mime
View raw message