From 2f76e52c8f9eebf81439b5304c2e57c102b9eea1 Mon Sep 17 00:00:00 2001 From: xia Date: Wed, 16 Sep 2015 10:55:06 +0800 Subject: [PATCH] tidb: update format --- tidb_test.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tidb_test.go b/tidb_test.go index a433c2da5d..e2fd6dee60 100644 --- a/tidb_test.go +++ b/tidb_test.go @@ -477,23 +477,19 @@ func checkAutocommit(c *C, se Session, stmt string, isNil, expect bool) { func (s *testSessionSuite) TestAutocommit(c *C) { store := newStore(c, s.dbName) se := newSession(c, store, s.dbName) - mustExecSQL(c, se, "drop table if exists t") - c.Assert(se.(*session).txn, IsNil) + checkAutocommit(c, se, "drop table if exists t", true, false) checkAutocommit(c, se, "create table t (id BIGINT PRIMARY KEY AUTO_INCREMENT NOT NULL)", true, false) checkAutocommit(c, se, "insert t values ()", true, false) checkAutocommit(c, se, "begin", false, true) checkAutocommit(c, se, "insert t values ()", false, true) - se.Execute("drop table if exists t;") - c.Assert(se.(*session).txn, IsNil) - c.Assert(variable.GetSessionVars(se.(*session)).DisableAutocommit, IsTrue) + checkAutocommit(c, se, "drop table if exists t;", true, true) checkAutocommit(c, se, "create table t (id BIGINT PRIMARY KEY AUTO_INCREMENT NOT NULL)", true, true) checkAutocommit(c, se, "insert t values ()", false, true) checkAutocommit(c, se, "commit", true, false) checkAutocommit(c, se, "insert t values ()", true, false) - se.Execute("drop table if exists t;") - mustExecSQL(c, se, "create table t (id BIGINT PRIMARY KEY AUTO_INCREMENT NOT NULL)") - c.Assert(variable.GetSessionVars(se.(*session)).DisableAutocommit, IsFalse) + checkAutocommit(c, se, "drop table if exists t;", true, false) + checkAutocommit(c, se, "create table t (id BIGINT PRIMARY KEY AUTO_INCREMENT NOT NULL)", true, false) checkAutocommit(c, se, "begin", false, true) checkAutocommit(c, se, "insert t values ()", false, true) checkAutocommit(c, se, "rollback", true, false)