couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [25/50] couch commit: updated refs/heads/master to 9d0ac7d
Date Thu, 28 Aug 2014 12:12:01 GMT
Amend a too-restrictive pattern match

We were asserting that the subpath contains exactly one element, but in
reality the subpath can be empty (which will result in an immediate
failure to merge on the next recursion).

BugzID: 30686


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/b580899f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/b580899f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/b580899f

Branch: refs/heads/master
Commit: b580899fe4ebb4328ad82c92a34c5fec28ee338e
Parents: 156c805
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Wed May 7 11:27:47 2014 -0400
Committer: Robert Newson <rnewson@apache.org>
Committed: Thu Aug 28 13:00:01 2014 +0100

----------------------------------------------------------------------
 src/couch_key_tree.erl | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/b580899f/src/couch_key_tree.erl
----------------------------------------------------------------------
diff --git a/src/couch_key_tree.erl b/src/couch_key_tree.erl
index 57c08a0..8007e17 100644
--- a/src/couch_key_tree.erl
+++ b/src/couch_key_tree.erl
@@ -139,6 +139,10 @@ merge_at(Nodes, Pos, [{IK, IV, [NextINode]}]) when Pos > 0 ->
         {Merged, Result} -> {[{IK, IV, Merged}], Result};
         fail -> fail
     end;
+merge_at(_Nodes, Pos, [{_IK, _IV, []}]) when Pos > 0 ->
+    % We've run out of path on the insert side, there's no way we can
+    % merge with this branch
+    fail;
 merge_at([{K, V, SubTree} | Sibs], Pos, INodes) when Pos < 0 ->
     % When Pos is negative, Depth was less than IDepth, so we
     % need to discard from the revision tree path


Mime
View raw message