Skip to content

Commit

Permalink
restore: don't restore auto id if the table doesn't has it. (pingcap#420
Browse files Browse the repository at this point in the history
) (pingcap#720)

* cherry pick pingcap#420 to release-4.0

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

* Update schema.go

Co-authored-by: 山岚 <36239017+YuJuncen@users.noreply.github.com>
Co-authored-by: 3pointer <luancheng@pingcap.com>
  • Loading branch information
3 people committed Jan 27, 2021
1 parent a878168 commit 022d477
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/backup/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ func BuildBackupRangeAndSchema(
switch {
case tableInfo.IsSequence():
globalAutoID, err = seqAlloc.NextGlobalAutoID(tableInfo.ID)
case tableInfo.IsView():
// no auto ID for views.
case tableInfo.IsView() || !utils.NeedAutoID(tableInfo):
// no auto ID for views or table without either rowID nor auto_increment ID.
default:
globalAutoID, err = idAlloc.NextGlobalAutoID(tableInfo.ID)
}
Expand Down

0 comments on commit 022d477

Please sign in to comment.