mirror of https://github.com/tidwall/buntdb.git
fix set transaction leak
This commit is contained in:
parent
8724f51bb5
commit
6363a756c0
|
@ -1390,7 +1390,9 @@ func (tx *Tx) Set(key, value string, opts *SetOptions) (previousValue string,
|
|||
// create a rollback entry with a nil value. A nil value indicates
|
||||
// that the entry should be deleted on rollback. When the value is
|
||||
// *not* nil, that means the entry should be reverted.
|
||||
if _, ok := tx.wc.rollbackItems[key]; !ok {
|
||||
tx.wc.rollbackItems[key] = nil
|
||||
}
|
||||
} else {
|
||||
// A previous item already exists in the database. Let's create a
|
||||
// rollback entry with the item as the value. We need to check the
|
||||
|
|
Loading…
Reference in New Issue