Merge pull request #209 from d2r2/d2r2-fix-unexpected-delete-bucket-error

Fix unexpected delete bucket error: "delete bucket: incompatible value"
pull/210/head
Gyuho Lee 2020-03-19 11:27:32 -07:00 committed by GitHub
commit a74531a954
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -230,7 +230,7 @@ func (b *Bucket) DeleteBucket(key []byte) error {
// Recursively delete all child buckets.
child := b.Bucket(key)
err := child.ForEach(func(k, v []byte) error {
if v == nil {
if _, _, childFlags := child.Cursor().seek(k); (childFlags & bucketLeafFlag) != 0 {
if err := child.DeleteBucket(k); err != nil {
return fmt.Errorf("delete bucket: %s", err)
}