From d5cf283f9102a194ab8f8ea7afb51c85cfd0c1bb Mon Sep 17 00:00:00 2001 From: shenli Date: Wed, 11 Nov 2015 15:09:26 +0800 Subject: [PATCH] *: Address comment --- tidb.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tidb.go b/tidb.go index 59240c18c9..e56d84bd61 100644 --- a/tidb.go +++ b/tidb.go @@ -218,7 +218,10 @@ func runStmt(ctx context.Context, s stmt.Statement, args ...interface{}) (rset.R err = ctx.FinishTxn(false) // We should retry for autocommit if terror.ErrorEqual(err, kv.ErrConditionNotMatch) { - return nil, ctx.(Session).Retry() + se, ok := ctx.(Session) + if ok { + return nil, se.Retry() + } } } return rs, errors.Trace(err)