Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lightning: fix incorrect _tidb_rowid allocator value after import for table with AUTO_ID_CACHE=1 #46171

Merged
merged 11 commits into from
Aug 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
D3Hunter committed Aug 16, 2023
commit b400e402cf7f092ef6fd486030681c0686dd035b
4 changes: 4 additions & 0 deletions br/pkg/lightning/importer/meta_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,10 @@ func (*singleTableMetaMgr) InitTableMeta(_ context.Context) error {
// not for allocator of _tidb_rowid.
// So we need to allocate IDs for those 2 allocators explicitly.
func (s *singleTableMetaMgr) AllocTableRowIDs(ctx context.Context, rowIDMax int64) (*verify.KVChecksum, int64, error) {
if !common.TableHasAutoID(s.tr.tableInfo.Core) {
return nil, 0, nil
}

if err := common.RebaseGlobalAutoID(ctx, 0, s.tr.kvStore, s.tr.dbInfo.ID, s.tr.tableInfo.Core); err != nil {
return nil, 0, errors.Trace(err)
}
Expand Down