From a95cb866043f25f09b40ec95140f16eb69d0adb1 Mon Sep 17 00:00:00 2001 From: "Damien F. Katz" Date: Wed, 9 Apr 2008 01:01:43 +0000 Subject: Fix for btree modification bug. git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@646163 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_btree.erl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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, -- cgit v1.2.3