From ce0754b0d30c8b41e45cccccfd948677cef77a9e Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Thu, 10 Jul 2014 14:50:21 -0600 Subject: Allow freelist overflow. This commit is a backwards compatible change that allows the freelist to overflow the page.count (uint16). It works by checking if the overflow will occur and marking the page.count as 0xFFFF and setting the actual count to the first element of the freelist. This approach was used because it's backwards compatible and it doesn't make sense to change the data type of all page counts when only the freelist's page can overflow. Fixes #192. --- bucket_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'bucket_test.go') diff --git a/bucket_test.go b/bucket_test.go index 0785753..13e6a8a 100644 --- a/bucket_test.go +++ b/bucket_test.go @@ -190,9 +190,8 @@ func TestBucket_Delete_Large(t *testing.T) { }) } -// Deleting a very large list of keys will overflow the freelist. -// https://github.com/boltdb/bolt/issues/192 -func TestBucket_Delete_ErrFreelistOverflow(t *testing.T) { +// Deleting a very large list of keys will cause the freelist to use overflow. +func TestBucket_Delete_FreelistOverflow(t *testing.T) { if testing.Short() { t.Skip("skipping test in short mode.") } @@ -233,7 +232,7 @@ func TestBucket_Delete_ErrFreelistOverflow(t *testing.T) { }) // Check that a freelist overflow occurred. - assert.Equal(t, ErrFreelistOverflow, err) + assert.NoError(t, err) }) } -- cgit v1.2.3