From 76896882a9b5bf2a476da912230a58860bbd41f3 Mon Sep 17 00:00:00 2001 From: siddontang Date: Mon, 25 Aug 2014 16:19:28 +0800 Subject: [PATCH] tx commit bugfix --- ledis/tx.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ledis/tx.go b/ledis/tx.go index 009bfac..38eb626 100644 --- a/ledis/tx.go +++ b/ledis/tx.go @@ -111,6 +111,8 @@ type Tx struct { tx *store.Tx logs [][]byte + + index uint8 } func (db *DB) IsTransaction() bool { @@ -132,6 +134,7 @@ func (db *DB) Begin() (*Tx, error) { tx.DB.dbLock.Lock() tx.DB.l = db.l + tx.index = db.index tx.DB.sdb = db.sdb @@ -201,3 +204,7 @@ func (tx *Tx) newBatch() *batch { return b } + +func (tx *Tx) Index() int { + return int(tx.index) +}