Skip to content

Commit

Permalink
Fix btree copy case_clause error
Browse files Browse the repository at this point in the history
Closes MB-4560.

Change-Id: Iabec1e870fbe74451ada31d7d94326170408a376
Reviewed-on: http://review.couchbase.org/11767
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Damien Katz <damien@couchbase.com>
  • Loading branch information
fdmanana authored and alk committed Dec 23, 2011
1 parent 2185965 commit 933e7e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/couchdb/couch_btree_copy.erl
Expand Up @@ -167,7 +167,7 @@ finish_copy(#acc{cur_level = Level, max_level = Level, nodes = Nodes} = Acc) ->

finish_copy(#acc{cur_level = Level, nodes = Nodes} = Acc) ->
case dict:fetch(Level, Nodes) of
[] when Level =:= 1 ->
[] ->
Acc2 = Acc#acc{cur_level = Level + 1},
finish_copy(Acc2);
[{LastKey, _} | _] = NodeList ->
Expand Down
4 changes: 3 additions & 1 deletion test/etap/022-btree-copy.t
Expand Up @@ -29,7 +29,7 @@ path(FileName) ->

main(_) ->
test_util:init_code_path(),
etap:plan(72),
etap:plan(76),
case (catch test()) of
ok ->
etap:end_tests();
Expand All @@ -55,6 +55,7 @@ test() ->
test_copy(700, ReduceCount),
test_copy(811, ReduceCount),
test_copy(2333, ReduceCount),
test_copy(6594, ReduceCount),
test_copy(6666, ReduceCount),
test_copy(9999, ReduceCount),
test_copy(15003, ReduceCount),
Expand All @@ -68,6 +69,7 @@ test() ->


test_copy(NumItems, ReduceFun) ->
etap:diag("Running btree copy test for " ++ integer_to_list(NumItems) ++ " items"),
KVs = [{I, I} || I <- lists:seq(1, NumItems)],

OriginalFileName = path(
Expand Down

0 comments on commit 933e7e8

Please sign in to comment.