Skip to content

Commit

Permalink
mvcc: use "t.tx.DB()" to fetch DB
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
  • Loading branch information
gyuho committed Jul 3, 2018
1 parent a9c4b98 commit 84d11a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mvcc/backend/batch_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func (t *batchTx) commit(stop bool) {
// Check if db is nil to prevent this panic
if t.tx.DB() != nil {
size := t.tx.Size()
db := t.backend.db
db := t.tx.DB()
atomic.StoreInt64(&t.backend.size, size)
atomic.StoreInt64(&t.backend.sizeInUse, size-(int64(db.Stats().FreePageN)*int64(db.Info().PageSize)))
}
Expand Down

0 comments on commit 84d11a5

Please sign in to comment.