couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [9/9] couch commit: updated refs/heads/windsor-merge to 2c36e16
Date Thu, 07 Aug 2014 17:57:26 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/79decf0f
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/79decf0f
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/79decf0f

Branch: refs/heads/windsor-merge
Commit: 79decf0fad9922000f157fe8dd117800735de0dc
Parents: b84a58b
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Wed May 7 11:27:47 2014 -0400
Committer: Robert Newson <rnewson@apache.org>
Committed: Thu Aug 7 18:55:10 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/79decf0f/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