You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/02/10 21:22:27 UTC

[05/50] couch commit: updated refs/heads/import to 09c6556

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 <ad...@cloudant.com>
Authored: Mon Dec 10 14:29:30 2012 -0500
Committer: Paul J. Davis <pa...@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) ->