Skip to content

Commit

Permalink
schema storage shallow copy DBInfo
Browse files Browse the repository at this point in the history
Signed-off-by: sdojjy <[email protected]>
  • Loading branch information
sdojjy committed Oct 19, 2021
1 parent 2331549 commit 1588561
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cdc/entry/schema_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (s *schemaSnapshot) Clone() *schemaSnapshot {

schemas := make(map[int64]*timodel.DBInfo, len(s.schemas))
for k, v := range s.schemas {
schemas[k] = v.Clone()
schemas[k] = v.Copy()
}
clone.schemas = schemas

Expand Down Expand Up @@ -389,7 +389,7 @@ func (s *schemaSnapshot) createSchema(db *timodel.DBInfo) error {
return cerror.ErrSnapshotSchemaExists.GenWithStackByArgs(db.Name, db.ID)
}

s.schemas[db.ID] = db.Clone()
s.schemas[db.ID] = db.Copy()
s.schemaNameToID[db.Name.O] = db.ID
s.tableInSchema[db.ID] = []int64{}

Expand All @@ -402,7 +402,7 @@ func (s *schemaSnapshot) replaceSchema(db *timodel.DBInfo) error {
if !ok {
return cerror.ErrSnapshotSchemaNotFound.GenWithStack("schema %s(%d) not found", db.Name, db.ID)
}
s.schemas[db.ID] = db.Clone()
s.schemas[db.ID] = db.Copy()
s.schemaNameToID[db.Name.O] = db.ID
return nil
}
Expand Down

0 comments on commit 1588561

Please sign in to comment.