Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wk989898 committed Jan 2, 2025
1 parent 561c359 commit c1fcba2
Showing 1 changed file with 12 additions and 92 deletions.
104 changes: 12 additions & 92 deletions logservice/schemastore/persist_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,11 @@ func TestApplyDDLJobs(t *testing.T) {
},
},
},
// trivial ddls
// test add/drop primary key and alter index visibility for table
// test modify table charset
// test alter table ttl/remove ttl
// test set TiFlash replica
{
[]mockDBInfo{
{
Expand All @@ -1333,109 +1337,25 @@ func TestApplyDDLJobs(t *testing.T) {
},
func() []*model.Job {
return []*model.Job{
buildAddPrimaryKeyJobForTest(100, 300, 1020, &model.IndexInfo{
buildAddPrimaryKeyJobForTest(100, 300, 1010, &model.IndexInfo{
ID: 500,
Name: pmodel.NewCIStr("idx1"),
Table: pmodel.NewCIStr("t1"),
Primary: true,
Invisible: true,
}),
buildAlterIndexVisibilityJobForTest(100, 300, 1030, &model.IndexInfo{
buildAlterIndexVisibilityJobForTest(100, 300, 1020, &model.IndexInfo{
ID: 500,
Name: pmodel.NewCIStr("idx1"),
Table: pmodel.NewCIStr("t1"),
Primary: true,
Invisible: false,
}),
buildDropPrimaryKeyJobForTest(100, 300, 1040),
}
}(),
map[int64]*BasicTableInfo{
300: {
SchemaID: 100,
Name: "t1",
},
},
nil,
map[int64]*BasicDatabaseInfo{
100: {
Name: "test",
Tables: map[int64]bool{
300: true,
},
},
},
map[int64][]uint64{300: {1020, 1030, 1040}},
nil,
nil,
nil,
nil,
},
// test modify table charset
{
[]mockDBInfo{
{
dbInfo: &model.DBInfo{
ID: 100,
Name: pmodel.NewCIStr("test"),
},
tables: []*model.TableInfo{
{
ID: 300,
Name: pmodel.NewCIStr("t1"),
},
},
},
},
func() []*model.Job {
return []*model.Job{
buildModifyTableCharsetJobForTest(100, 300, 1010, charset.CharsetUTF8MB4),
}
}(),
map[int64]*BasicTableInfo{
300: {
SchemaID: 100,
Name: "t1",
},
},
nil,
map[int64]*BasicDatabaseInfo{
100: {
Name: "test",
Tables: map[int64]bool{
300: true,
},
},
},
map[int64][]uint64{300: {1010}},
nil,
nil,
nil,
nil,
},
// trivial ddls
// test alter table ttl/remove ttl
// test set TiFlash replica
{
[]mockDBInfo{
{
dbInfo: &model.DBInfo{
ID: 100,
Name: pmodel.NewCIStr("test"),
},
tables: []*model.TableInfo{
{
ID: 300,
Name: pmodel.NewCIStr("t1"),
},
},
},
},
func() []*model.Job {
return []*model.Job{
buildAlterTTLJobForTest(100, 300, 1010),
buildRemoveTTLJobForTest(100, 300, 1020),
buildSetTiFlashReplicaJobForTest(100, 300, 1030),
buildDropPrimaryKeyJobForTest(100, 300, 1030),
buildModifyTableCharsetJobForTest(100, 300, 1040, charset.CharsetUTF8MB4),
buildAlterTTLJobForTest(100, 300, 1050),
buildRemoveTTLJobForTest(100, 300, 1060),
buildSetTiFlashReplicaJobForTest(100, 300, 1070),
}
}(),
map[int64]*BasicTableInfo{
Expand All @@ -1453,7 +1373,7 @@ func TestApplyDDLJobs(t *testing.T) {
},
},
},
map[int64][]uint64{300: {1010, 1020, 1030}},
map[int64][]uint64{300: {1010, 1020, 1030, 1040, 1050, 1060, 1070}},
nil,
nil,
nil,
Expand Down

0 comments on commit c1fcba2

Please sign in to comment.