summaryrefslogtreecommitdiff
path: root/src/couchdb
diff options
context:
space:
mode:
authorRobert Newson <rnewson@apache.org>2011-01-28 17:52:43 +0000
committerRobert Newson <rnewson@apache.org>2011-01-28 17:52:43 +0000
commite9fa396941f2738f9ba10a4521f0415b2c612f1c (patch)
treed2e3b4d3e175f29b114697e8f3618d16e06db96b /src/couchdb
parenta666c0a3ea2fe0b65e8fb9b5034c8d9a64f5a905 (diff)
COUCHDB-1047 - support inclusive_end with reduce calls
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1064801 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r--src/couchdb/couch_btree.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/couchdb/couch_btree.erl b/src/couchdb/couch_btree.erl
index c63cd8cf..f8c126f3 100644
--- a/src/couchdb/couch_btree.erl
+++ b/src/couchdb/couch_btree.erl
@@ -72,7 +72,10 @@ final_reduce(Reduce, {KVs, Reductions}) ->
fold_reduce(#btree{root=Root}=Bt, Fun, Acc, Options) ->
Dir = couch_util:get_value(dir, Options, fwd),
StartKey = couch_util:get_value(start_key, Options),
- EndKey = couch_util:get_value(end_key, Options),
+ EndKey = case couch_util:get_value(end_key_gt, Options) of
+ undefined -> couch_util:get_value(end_key, Options);
+ LastKey -> LastKey
+ end,
KeyGroupFun = couch_util:get_value(key_group_fun, Options, fun(_,_) -> true end),
{StartKey2, EndKey2} =
case Dir of