mirror of https://github.com/etcd-io/bbolt.git
Fix unexpected delete bucket error
parent
da442c51f1
commit
c41b6f7c53
|
@ -228,7 +228,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