Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: qupeng <[email protected]>
  • Loading branch information
hicqu committed Dec 22, 2021
1 parent c779190 commit 3bf577c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ddl/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ func TestRenameTables(t *testing.T) {

txn, _ := ctx.Txn(true)
historyJob, _ := meta.NewMeta(txn).GetHistoryDDLJob(job.ID)
wantTblInfos := historyJob.BinlogInfo.MultipleTableInfo
wantTblInfos := historyJob.BinlogInfo.MultipleTableInfos
require.Equal(t, wantTblInfos[0].Name.L, "tt1")
require.Equal(t, wantTblInfos[1].Name.L, "tt2")
}
8 changes: 5 additions & 3 deletions parser/model/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ type HistoryInfo struct {
TableInfo *TableInfo
FinishedTS uint64

// MultipleTableInfo is like TableInfo but only for operations updating multiple DBs.
MultipleTableInfo []*TableInfo
// MultipleTableInfos is like TableInfo but only for operations updating multiple tables.
MultipleTableInfos []*TableInfo
}

// AddDBInfo adds schema version and schema information that are used for binlog.
Expand All @@ -199,6 +199,7 @@ func (h *HistoryInfo) Clean() {
h.SchemaVersion = 0
h.DBInfo = nil
h.TableInfo = nil
h.MultipleTableInfos = nil
}

// DDLReorgMeta is meta info of DDL reorganization.
Expand Down Expand Up @@ -288,7 +289,8 @@ func (job *Job) FinishMultipleTableJob(jobState JobState, schemaState SchemaStat
job.State = jobState
job.SchemaState = schemaState
job.BinlogInfo.SchemaVersion = ver
job.BinlogInfo.MultipleTableInfo = tblInfos
job.BinlogInfo.MultipleTableInfos = tblInfos
job.BinlogInfo.TableInfo = tblInfos[len(tblInfos)-1]
}

// FinishDBJob is called when a job is finished.
Expand Down

0 comments on commit 3bf577c

Please sign in to comment.