Skip to content

Commit

Permalink
Test cleanup, don't leave global variables changed after test
Browse files Browse the repository at this point in the history
  • Loading branch information
mjonss committed Apr 10, 2023
1 parent 76f02d8 commit 7662330
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ddl/column_type_change_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2431,12 +2431,15 @@ func TestFixDDLTxnWillConflictWithReorgTxnNotConcurrent(t *testing.T) {
store := testkit.CreateMockStore(t)
tk0 := testkit.NewTestKit(t, store)
tk0.MustExec("set @@global.tidb_enable_metadata_lock=0")
defer tk0.MustExec("set @@global.tidb_enable_metadata_lock = default")
tk0.MustExec("set @@global.tidb_enable_concurrent_ddl = off")
defer tk0.MustExec("set @@global.tidb_enable_concurrent_ddl = default")
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")

tk.MustExec("create table t (a int)")
tk.MustExec("set global tidb_ddl_enable_fast_reorg = OFF")
defer tk.MustExec("set global tidb_ddl_enable_fast_reorg = default")
tk.MustExec("alter table t add index(a)")
tk.MustExec("set @@sql_mode=''")
tk.MustExec("insert into t values(128),(129)")
Expand All @@ -2452,6 +2455,7 @@ func TestFixDDLTxnWillConflictWithReorgTxn(t *testing.T) {

tk.MustExec("create table t (a int)")
tk.MustExec("set global tidb_ddl_enable_fast_reorg = OFF")
defer tk.MustExec("set global tidb_ddl_enable_fast_reorg = default")
tk.MustExec("alter table t add index(a)")
tk.MustExec("set @@sql_mode=''")
tk.MustExec("insert into t values(128),(129)")
Expand Down

0 comments on commit 7662330

Please sign in to comment.