Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
3pointer committed Mar 28, 2021
1 parent 10516be commit 41b1fe7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pkg/restore/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package restore
import (
"context"
"fmt"
"math"
"sort"

"github.com/pingcap/errors"
Expand Down Expand Up @@ -164,12 +163,11 @@ func (db *DB) CreateTable(ctx context.Context, table *utils.Table) error {
var autoIncID uint64
// auto inc id overflow
if table.Info.AutoIncID < 0 {
if table.Info.IsAutoIncColUnsigned() {
autoIncID = math.MaxUint64
} else {
autoIncID = math.MaxInt64
}
} else {
log.Info("table auto inc id overflow",
zap.Stringer("db", table.Db.Name),
zap.Stringer("table", table.Info.Name),
zap.Int64("auto inc id", table.Info.AutoIncID),
)
autoIncID = uint64(table.Info.AutoIncID)
}
restoreMetaSQL = fmt.Sprintf(
Expand Down

0 comments on commit 41b1fe7

Please sign in to comment.