From d8e4cffa12444da138a4fd0f67dfd665844c9912 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Tue, 25 Mar 2014 07:25:00 -0600 Subject: Fix bucket reclamation. The bucket page is allocated separately from the rest of the pages but the old bucket pages were not being added to the freelist. This change fixes that and adds a simple check for database consistency. More advanced consistency checks can be added in the future. Fixes #82. --- tx_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tx_test.go') diff --git a/tx_test.go b/tx_test.go index 58cfc95..0694b3b 100644 --- a/tx_test.go +++ b/tx_test.go @@ -230,7 +230,7 @@ func TestTxDeleteBucket(t *testing.T) { db.Update(func(tx *Tx) error { // Verify that the bucket's page is free. - assert.Equal(t, []pgid{root}, db.freelist.all()) + assert.Equal(t, []pgid{6, root, 3}, db.freelist.all()) // Create the bucket again and make sure there's not a phantom value. assert.NoError(t, tx.CreateBucket("widgets")) -- cgit v1.2.3