diff options
author | Robert Newson <rnewson@apache.org> | 2011-01-28 17:49:37 +0000 |
---|---|---|
committer | Adam Kocoloski <adam@cloudant.com> | 2011-01-28 16:14:16 -0500 |
commit | fb799cc8e99cf2be5aad7fa294ddd69c7141620d (patch) | |
tree | f52fddf70aa527f5f123c63bf3cf2e06a8785a28 /apps/couch/src | |
parent | ff9036784e5f3f722f71a536c50b37723595add1 (diff) |
COUCHDB-1047 - support inclusive_end with reduce calls
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@1064800 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'apps/couch/src')
-rw-r--r-- | apps/couch/src/couch_btree.erl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/couch/src/couch_btree.erl b/apps/couch/src/couch_btree.erl index 4ed3fe54..5b950dc1 100644 --- a/apps/couch/src/couch_btree.erl +++ b/apps/couch/src/couch_btree.erl @@ -76,7 +76,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 |