Skip to content

Commit

Permalink
br: make restore resource group compatible with old tidb (#42388) (#4…
Browse files Browse the repository at this point in the history
…2418)

ref #42266, close #42365
  • Loading branch information
ti-chi-bot authored Mar 21, 2023
1 parent 9b0d4c4 commit a4ab759
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion br/pkg/restore/systable_restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,11 @@ func (rc *Client) replaceTemporaryTableToSystable(ctx context.Context, ti *model
sql := fmt.Sprintf("UPDATE %s SET User_attributes = JSON_REMOVE(User_attributes, '$.resource_group');",
utils.EncloseDBAndTable(db.TemporaryName.L, sysUserTableName))
if err := execSQL(sql); err != nil {
return err
// FIXME: find a better way to check the error or we should check the version here instead.
if !strings.Contains(err.Error(), "Unknown column 'User_attributes' in 'field list'") {
return err
}
log.Warn("remove resource group meta failed, please ensure target cluster is newer than v6.6.0", logutil.ShortError(err))
}
}

Expand Down

0 comments on commit a4ab759

Please sign in to comment.