aboutsummaryrefslogtreecommitdiff
path: root/db.go
diff options
context:
space:
mode:
Diffstat (limited to 'db.go')
-rw-r--r--db.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/db.go b/db.go
index d96a161..0b74621 100644
--- a/db.go
+++ b/db.go
@@ -705,6 +705,10 @@ func (m *meta) copy(dest *meta) {
// write writes the meta onto a page.
func (m *meta) write(p *page) {
+
+ _assert(m.root.root < m.pgid, "root bucket pgid (%d) above high water mark (%d)", m.root.root, m.pgid)
+ _assert(m.freelist < m.pgid, "freelist pgid (%d) above high water mark (%d)", m.freelist, m.pgid)
+
// Page id is either going to be 0 or 1 which we can determine by the transaction ID.
p.id = pgid(m.txid % 2)
p.flags |= metaPageFlag