summaryrefslogtreecommitdiff
path: root/src/couchdb
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2008-04-09 01:01:43 +0000
committerDamien F. Katz <damien@apache.org>2008-04-09 01:01:43 +0000
commita95cb866043f25f09b40ec95140f16eb69d0adb1 (patch)
treee709ead907ade35252c3c54a7e40ce1623410e01 /src/couchdb
parent7a09c2f403deed1025da9c4963f3787ac72758e2 (diff)
Fix for btree modification bug.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@646163 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb')
-rw-r--r--src/couchdb/couch_btree.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/couchdb/couch_btree.erl b/src/couchdb/couch_btree.erl
index 62d42c09..5b7ac65a 100644
--- a/src/couchdb/couch_btree.erl
+++ b/src/couchdb/couch_btree.erl
@@ -289,17 +289,20 @@ write_node(Bt, NodeType, NodeList) ->
],
{ok, ResultList, Bt}.
+
modify_kpnode(Bt, KPs, [], ResultNode, QueryOutput) ->
% processed all queries for the current tree
{ok, lists:reverse(ResultNode, KPs), QueryOutput, Bt};
+modify_kpnode(Bt, [], Actions, [], QueryOutput) ->
+ modify_node(Bt, nil, Actions, QueryOutput);
+
modify_kpnode(Bt, [], Actions, [{_Key, PointerInfo} | ResultNode], QueryOutput) ->
{ok, ChildKPs, QueryOutput2, Bt2} = modify_node(Bt, PointerInfo, Actions, QueryOutput),
{ok, lists:reverse(ResultNode, ChildKPs), QueryOutput2, Bt2};
modify_kpnode(Bt, [{Key,PointerInfo} | RestKPs], Actions, ResultNode, QueryOutput) ->
- % Split the actions into two lists, queries of values less
- % than equals, and greater than the current key
+ % Split the actions into two lists, queries of values <= and > than the current key
SplitFun = fun({_ActionType, ActionKey, _ActionValue}) ->
not less(Bt, Key, ActionKey)
end,