tidb: update format
This commit is contained in:
12
tidb_test.go
12
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)
|
||||
|
||||
Reference in New Issue
Block a user