From bb8c623f8840933fd22d1bad41ba68993aa2e019 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Sun, 11 Feb 2018 16:43:59 +0000 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20use=20readonly=20transactions?= =?UTF-8?q?=20for=20mysql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kvs/mysql/db.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/kvs/mysql/db.go b/kvs/mysql/db.go index 8987bd06..9b1686d7 100644 --- a/kvs/mysql/db.go +++ b/kvs/mysql/db.go @@ -31,7 +31,7 @@ type DB struct { func (db *DB) Begin(ctx context.Context, writable bool) (txn kvs.TX, err error) { var pntr *sql.Tx - if pntr, err = db.pntr.BeginTx(ctx, db.opt(writable)); err != nil { + if pntr, err = db.pntr.BeginTx(ctx, &sql.TxOptions{}); err != nil { log.WithPrefix("kvs").Errorln(err) err = &kvs.DBError{Err: err} return @@ -50,9 +50,3 @@ func (db *DB) Export(w io.Writer) (err error) { func (db *DB) Close() (err error) { return db.pntr.Close() } - -func (db *DB) opt(writable bool) *sql.TxOptions { - return &sql.TxOptions{ - ReadOnly: !writable, - } -}