Merge pull request #761 from ahrtr/verify_inline_bucket_20240604

Add verification on the pageID when creating nodes for inline buckets
pull/764/head
Benjamin Wang 2024-06-05 17:57:12 +01:00 committed by GitHub
commit b342624aaf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -876,6 +876,12 @@ func (b *Bucket) node(pgId common.Pgid, parent *node) *node {
var p = b.page
if p == nil {
p = b.tx.page(pgId)
} else {
// if p isn't nil, then it's an inline bucket.
// The pgId must be 0 in this case.
common.Verify(func() {
common.Assert(pgId == 0, "The page ID (%d) isn't 0 for an inline bucket", pgId)
})
}
// Read the page into the node and cache it.