Skip to content

Commit

Permalink
Merge pull request #209 from d2r2/d2r2-fix-unexpected-delete-bucket-e…
Browse files Browse the repository at this point in the history
…rror

Fix unexpected delete bucket error: "delete bucket: incompatible value"
  • Loading branch information
gyuho authored Mar 19, 2020
2 parents 2fc6815 + c41b6f7 commit a74531a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit a74531a

Please sign in to comment.