aboutsummaryrefslogtreecommitdiff
path: root/node.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-05-09 09:38:08 -0600
committerBen Johnson <benbjohnson@yahoo.com>2014-05-09 09:38:08 -0600
commitd1b21e619d11001e069ba793bb023951cd6f15fd (patch)
tree058209a444636914495eaa47621d7811a11156c0 /node.go
parentFix deletion reclamation. (diff)
parentFix node unit tests. (diff)
downloaddedo-d1b21e619d11001e069ba793bb023951cd6f15fd.tar.gz
dedo-d1b21e619d11001e069ba793bb023951cd6f15fd.tar.xz
Merge branch 'master' of https://github.com/boltdb/bolt into fix-deletion
Conflicts: node.go
Diffstat (limited to 'node.go')
-rw-r--r--node.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/node.go b/node.go
index d9ab1ad..5ad581e 100644
--- a/node.go
+++ b/node.go
@@ -96,6 +96,7 @@ func (n *node) prevSibling() *node {
// put inserts a key/value.
func (n *node) put(oldKey, newKey, value []byte, pgid pgid, flags uint32) {
+ _assert(pgid < n.bucket.tx.meta.pgid, "pgid (%d) above high water mark (%d)", pgid, n.bucket.tx.meta.pgid)
_assert(len(oldKey) > 0, "put: zero-length old key")
_assert(len(newKey) > 0, "put: zero-length new key")
@@ -284,6 +285,7 @@ func (n *node) spill() error {
}
// Write the node.
+ _assert(p.id < tx.meta.pgid, "pgid (%d) above high water mark (%d)", p.id, tx.meta.pgid)
node.pgid = p.id
node.write(p)
@@ -314,6 +316,7 @@ func (n *node) spill() error {
}
// Write the new root.
+ _assert(p.id < tx.meta.pgid, "pgid (%d) above high water mark (%d)", p.id, tx.meta.pgid)
parent.pgid = p.id
parent.write(p)
}