diff --git a/tidb_test.go b/tidb_test.go index 5b6439005d..724074b212 100644 --- a/tidb_test.go +++ b/tidb_test.go @@ -488,7 +488,10 @@ func (s *testSessionSuite) TestAutoincrementID(c *C) { se.Execute("drop table if exists t;") mustExecSQL(c, se, "create table t (id BIGINT PRIMARY KEY AUTO_INCREMENT NOT NULL)") mustExecSQL(c, se, "insert t values ()") - c.Assert(se.LastInsertID(), Less, uint64(4)) + lastID := se.LastInsertID() + c.Assert(lastID, Less, uint64(4)) + mustExecSQL(c, se, "insert t () values ()") + c.Assert(se.LastInsertID(), Greater, lastID) mustExecSQL(c, se, s.dropDBSQL) }