From b870261adcd15b6ccd56f1ee15fd04cad14bc1a6 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Sat, 7 Aug 2010 20:33:33 +0000 Subject: builtin reduce functions more forgiving about trailing whitespace and other characters git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@983307 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_query_servers.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/couchdb/couch_query_servers.erl') diff --git a/src/couchdb/couch_query_servers.erl b/src/couchdb/couch_query_servers.erl index b2aa7a12..c4f1bf0b 100644 --- a/src/couchdb/couch_query_servers.erl +++ b/src/couchdb/couch_query_servers.erl @@ -143,16 +143,16 @@ os_rereduce(Lang, OsRedSrcs, KVs) -> builtin_reduce(_Re, [], _KVs, Acc) -> {ok, lists:reverse(Acc)}; -builtin_reduce(Re, [<<"_sum">>|BuiltinReds], KVs, Acc) -> +builtin_reduce(Re, [<<"_sum",_/binary>>|BuiltinReds], KVs, Acc) -> Sum = builtin_sum_rows(KVs), builtin_reduce(Re, BuiltinReds, KVs, [Sum|Acc]); -builtin_reduce(reduce, [<<"_count">>|BuiltinReds], KVs, Acc) -> +builtin_reduce(reduce, [<<"_count",_/binary>>|BuiltinReds], KVs, Acc) -> Count = length(KVs), builtin_reduce(reduce, BuiltinReds, KVs, [Count|Acc]); -builtin_reduce(rereduce, [<<"_count">>|BuiltinReds], KVs, Acc) -> +builtin_reduce(rereduce, [<<"_count",_/binary>>|BuiltinReds], KVs, Acc) -> Count = builtin_sum_rows(KVs), builtin_reduce(rereduce, BuiltinReds, KVs, [Count|Acc]); -builtin_reduce(Re, [<<"_stats">>|BuiltinReds], KVs, Acc) -> +builtin_reduce(Re, [<<"_stats",_/binary>>|BuiltinReds], KVs, Acc) -> Stats = builtin_stats(Re, KVs), builtin_reduce(Re, BuiltinReds, KVs, [Stats|Acc]). -- cgit v1.2.3