Skip to content

Commit

Permalink
lightning: save NEXT_GLOBAL_ROW_ID as uint64 instead of int64
Browse files Browse the repository at this point in the history
  • Loading branch information
lyzx2001 committed Jul 31, 2023
1 parent d2a1d02 commit 296f45f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions br/pkg/lightning/backend/tidb/tidb.go
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,8 @@ func FetchTableAutoIDInfos(ctx context.Context, exec utils.QueryExecutor, tableN
var autoIDInfos []*TableAutoIDInfo
for rows.Next() {
var (
dbName, tblName, columnName, nextID, idType string
dbName, tblName, columnName, idType string
nextID uint64
)
columns, err := rows.Columns()
if err != nil {
Expand All @@ -907,14 +908,9 @@ func FetchTableAutoIDInfos(ctx context.Context, exec utils.QueryExecutor, tableN
if err != nil {
return nil, errors.Trace(err)
}
var nextIDUint uint64
nextIDUint, err = strconv.ParseUint(nextID, 0, 64)
if err != nil {
return nil, errors.Trace(err)
}
autoIDInfos = append(autoIDInfos, &TableAutoIDInfo{
Column: columnName,
NextID: nextIDUint,
NextID: nextID,
Type: idType,
})
}
Expand Down

0 comments on commit 296f45f

Please sign in to comment.