Skip to content

Commit

Permalink
infoschema_v2: fix TestPartitionAddIndexGC (pingcap#52163)
Browse files Browse the repository at this point in the history
  • Loading branch information
GMHDBJD authored Apr 2, 2024
1 parent 3cfea6a commit c1344e1
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions pkg/infoschema/infoschema_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ func (b *Builder) applyDropTableV2(diff *model.SchemaDiff, dbInfo *model.DBInfo,
}

// The old DBInfo still holds a reference to old table info, we need to remove it.
b.deleteReferredForeignKeysV2(dbInfo, tableID)
b.infoSchema.deleteReferredForeignKeys(dbInfo.Name, table.Meta())

b.infoData.remove(tableItem{
dbName: dbInfo.Name.L,
Expand All @@ -786,16 +786,6 @@ func (b *Builder) applyDropTableV2(diff *model.SchemaDiff, dbInfo *model.DBInfo,
return affected
}

func (b *Builder) deleteReferredForeignKeysV2(dbInfo *model.DBInfo, tableID int64) {
for _, tbl := range b.infoschemaV2.SchemaTables(dbInfo.Name) {
tblInfo := tbl.Meta()
if tblInfo.ID == tableID {
b.infoSchema.deleteReferredForeignKeys(dbInfo.Name, tblInfo)
break
}
}
}

func (b *Builder) applyModifySchemaCharsetAndCollateV2(m *meta.Meta, diff *model.SchemaDiff) error {
di, err := m.GetDatabase(diff.SchemaID)
if err != nil {
Expand Down

0 comments on commit c1344e1

Please sign in to comment.