mirror of https://github.com/etcd-io/bbolt.git
Merge pull request #209 from d2r2/d2r2-fix-unexpected-delete-bucket-error
Fix unexpected delete bucket error: "delete bucket: incompatible value"pull/210/head
commit
a74531a954
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue