couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [05/50] couch commit: updated refs/heads/import to c3116d7
Date Tue, 04 Feb 2014 23:06:18 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/e5e5880b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/e5e5880b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/e5e5880b

Branch: refs/heads/import
Commit: e5e5880b27218a067ba49def549c8b311cb33418
Parents: 5a2ec4f
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: Tue Feb 4 17:03:23 2014 -0600

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


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/e5e5880b/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