diff --git a/.gitignore b/.gitignore index c842500c13..0deb8a2183 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ tests/integrationtest/integration-test.out tests/integrationtest/integrationtest_tidb-server tests/integrationtest/portgenerator tests/integrationtest/s/ +tests/integrationtest/replayer/ *.fail.go tools/bin/ vendor @@ -39,3 +40,4 @@ bazel-tidb *.log.json genkeyword test_coverage +coverage.dat diff --git a/pkg/session/bootstrap_test.go b/pkg/session/bootstrap_test.go index f503fdc40b..39d5399dbb 100644 --- a/pkg/session/bootstrap_test.go +++ b/pkg/session/bootstrap_test.go @@ -18,6 +18,7 @@ import ( "context" "fmt" "sort" + "strings" "testing" "time" @@ -334,6 +335,19 @@ func TestUpgrade(t *testing.T) { require.Equal(t, 1, req.NumRows()) require.Equal(t, "False", req.GetRow(0).GetString(0)) require.NoError(t, r.Close()) + + r = MustExecToRecodeSet(t, se2, "admin show ddl jobs 1000;") + req = r.NewChunk(nil) + err = r.Next(ctx, req) + require.NoError(t, err) + rowCnt := req.NumRows() + for i := 0; i < rowCnt; i++ { + jobType := req.GetRow(i).GetString(3) // get job type. + // Should not use multi-schema change in bootstrap DDL because the job arguments may be changed. + require.False(t, strings.Contains(jobType, "multi-schema")) + } + require.NoError(t, r.Close()) + dom.Close() } @@ -518,15 +532,6 @@ func TestStmtSummary(t *testing.T) { require.NoError(t, r.Close()) } -type bindTestStruct struct { - originText string - bindText string - db string - originWithDB string - bindWithDB string - deleteText string -} - func TestUpdateDuplicateBindInfo(t *testing.T) { ctx := context.Background() store, dom := CreateStoreAndBootstrap(t) diff --git a/pkg/session/mock_bootstrap.go b/pkg/session/mock_bootstrap.go index 9a200b6518..d10c0dc888 100644 --- a/pkg/session/mock_bootstrap.go +++ b/pkg/session/mock_bootstrap.go @@ -66,8 +66,9 @@ var allDDLs = []string{ "alter table mock_sys_t alter index idx_v invisible", "alter table mock_sys_partition add partition (partition p6 values less than (8192))", "alter table mock_sys_partition drop partition p6", - "alter table mock_sys_t add index mul_idx1(c1), add index mul_idx2(c1)", - "alter table mock_sys_t drop index mul_idx1, drop index mul_idx2", + // Should not use multi-schema change to add index in bootstrap DDL. + // "alter table mock_sys_t add index mul_idx1(c1), add index mul_idx2(c1)", + // "alter table mock_sys_t drop index mul_idx1, drop index mul_idx2", // TODO: Support check the DB for ActionAlterPlacementPolicy. // "alter database mock_sys_db_placement placement policy = 'alter_x'", "alter table mock_sys_t add index rename_idx1(c1)",