diff options
author | Robert Newson <rnewson@apache.org> | 2020-11-12 23:53:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-12 23:53:18 +0000 |
commit | 679fc835f0e52cdcbe811fc6a6b7434ecf636172 (patch) | |
tree | 247f2c85df9f67aa1c7754cc86afb62788dfd7cb | |
parent | 1a138804f692d0e578a7d4a19f9f13099a59a1cd (diff) | |
parent | 263efd21d3e8f8e9c15bcbfd5866ec55cee10336 (diff) | |
download | couchdb-679fc835f0e52cdcbe811fc6a6b7434ecf636172.tar.gz |
Merge pull request #3263 from apache/fix-ebtree-range-clears
Avoid deleting UUID keys that start with zeros
-rw-r--r-- | src/ebtree/src/ebtree.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ebtree/src/ebtree.erl b/src/ebtree/src/ebtree.erl index 31e1fc842..1a65c9a5e 100644 --- a/src/ebtree/src/ebtree.erl +++ b/src/ebtree/src/ebtree.erl @@ -56,7 +56,7 @@ -define(META_ORDER, 0). -define(NODE, 1). --define(NODE_ROOT_ID, <<0>>). +-define(NODE_ROOT_ID, <<0:128>>). -define(underflow(Tree, Node), Tree#tree.min > length(Node#node.members)). -define(at_min(Tree, Node), Tree#tree.min == length(Node#node.members)). @@ -1012,7 +1012,7 @@ set_node(Tx, #tree{} = Tree, #node{} = Node) -> persist(Tree, Tx, set, [Key, Value]). -node_key(Prefix, Id) when is_binary(Prefix), is_binary(Id) -> +node_key(Prefix, Id) when is_binary(Prefix), is_binary(Id), bit_size(Id) =:= 128 -> erlfdb_tuple:pack({?NODE, Id}, Prefix). |