ddl, test: delete unstable code that cause test failed in ddl (#18230)
* delete unstable code * change TestCommitWhenSchemaChange to testIntegrationSuite7 Co-authored-by: Lynn <zimu_xia@126.com>
This commit is contained in:
@ -2317,7 +2317,7 @@ func (s *testIntegrationSuite3) TestUnsupportedPartitionManagementDDLs(c *C) {
|
||||
c.Assert(err, ErrorMatches, ".*alter table partition is unsupported")
|
||||
}
|
||||
|
||||
func (s *testIntegrationSuite3) TestCommitWhenSchemaChange(c *C) {
|
||||
func (s *testIntegrationSuite7) TestCommitWhenSchemaChange(c *C) {
|
||||
tk := testkit.NewTestKit(c, s.store)
|
||||
tk.MustExec("use test")
|
||||
tk.MustExec(`create table schema_change (a int, b timestamp)
|
||||
@ -2338,8 +2338,10 @@ func (s *testIntegrationSuite3) TestCommitWhenSchemaChange(c *C) {
|
||||
tk.MustExec("insert into schema_change values (5, '2019-12-25 13:27:43')")
|
||||
tk.MustExec("insert into schema_change values (9, '2019-12-25 13:27:44')")
|
||||
atomic.StoreUint32(&session.SchemaChangedWithoutRetry, 1)
|
||||
defer func() {
|
||||
atomic.StoreUint32(&session.SchemaChangedWithoutRetry, 0)
|
||||
}()
|
||||
_, err := tk.Se.Execute(context.Background(), "commit")
|
||||
atomic.StoreUint32(&session.SchemaChangedWithoutRetry, 0)
|
||||
c.Assert(domain.ErrInfoSchemaChanged.Equal(err), IsTrue)
|
||||
|
||||
// Cover a bug that schema validator does not prevent transaction commit when
|
||||
@ -2357,10 +2359,7 @@ func (s *testIntegrationSuite3) TestCommitWhenSchemaChange(c *C) {
|
||||
tk.MustExec("insert into nt values (1), (3), (5);")
|
||||
tk2.MustExec("alter table pt exchange partition p1 with table nt;")
|
||||
tk.MustExec("insert into nt values (7), (9);")
|
||||
|
||||
atomic.StoreUint32(&session.SchemaChangedWithoutRetry, 1)
|
||||
_, err = tk.Se.Execute(context.Background(), "commit")
|
||||
atomic.StoreUint32(&session.SchemaChangedWithoutRetry, 0)
|
||||
c.Assert(domain.ErrInfoSchemaChanged.Equal(err), IsTrue)
|
||||
|
||||
tk.MustExec("admin check table pt")
|
||||
@ -2372,9 +2371,7 @@ func (s *testIntegrationSuite3) TestCommitWhenSchemaChange(c *C) {
|
||||
tk.MustExec("insert into pt values (1), (3), (5);")
|
||||
tk2.MustExec("alter table pt exchange partition p1 with table nt;")
|
||||
tk.MustExec("insert into pt values (7), (9);")
|
||||
atomic.StoreUint32(&session.SchemaChangedWithoutRetry, 1)
|
||||
_, err = tk.Se.Execute(context.Background(), "commit")
|
||||
atomic.StoreUint32(&session.SchemaChangedWithoutRetry, 0)
|
||||
c.Assert(domain.ErrInfoSchemaChanged.Equal(err), IsTrue)
|
||||
|
||||
tk.MustExec("admin check table pt")
|
||||
|
||||
Reference in New Issue
Block a user