Skip to content

Commit

Permalink
resovle conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
AilinKid committed Apr 26, 2020
1 parent 30c4690 commit f6eb817
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions ddl/ddl_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"bytes"
"context"
"fmt"
"math"
"strconv"
"strings"
"sync/atomic"
Expand Down Expand Up @@ -2127,7 +2126,7 @@ func (d *ddl) RebaseAutoID(ctx sessionctx.Context, ident ast.Ident, newBase int6
if err != nil {
return errors.Trace(err)
}
autoIncID, err := t.Allocators(ctx).Get(tp).NextGlobalAutoID(t.Meta().ID)
autoIncID, err := t.Allocator(ctx, tp).NextGlobalAutoID(t.Meta().ID)
if err != nil {
return errors.Trace(err)
}
Expand Down
2 changes: 1 addition & 1 deletion executor/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func updateRecord(ctx sessionctx.Context, h int64, oldData, newData []types.Datu
if err != nil {
return false, false, 0, err
}
if err = t.RebaseAutoID(sctx, recordID, true, autoid.RowIDAllocType); err != nil {
if err = t.RebaseAutoID(ctx, recordID, true, autoid.RowIDAllocType); err != nil {
return false, false, 0, err
}
}
Expand Down
4 changes: 2 additions & 2 deletions infoschema/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (b *Builder) ApplyDiff(m *meta.Meta, diff *model.SchemaDiff) ([]int64, erro
if tableIDIsValid(newTableID) {
// All types except DropTableOrView.
var err error
tblIDs, err = b.applyCreateTable(m, dbInfo, newTableID, allocs, tblIDs)
tblIDs, err = b.applyCreateTable(m, dbInfo, newTableID, allocs, diff.Type, tblIDs)
if err != nil {
return nil, errors.Trace(err)
}
Expand Down Expand Up @@ -220,7 +220,7 @@ func (b *Builder) copySortedTablesBucket(bucketIdx int) {
b.is.sortedTablesBuckets[bucketIdx] = newSortedTables
}

func (b *Builder) applyCreateTable(m *meta.Meta, dbInfo *model.DBInfo, tableID int64, allocs autoid.Allocators, affected []int64) ([]int64, error) {
func (b *Builder) applyCreateTable(m *meta.Meta, dbInfo *model.DBInfo, tableID int64, allocs autoid.Allocators, tp model.ActionType, affected []int64) ([]int64, error) {
tblInfo, err := m.GetTable(dbInfo.ID, tableID)
if err != nil {
return nil, errors.Trace(err)
Expand Down
3 changes: 2 additions & 1 deletion table/tables/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,8 @@ func (t *tableCommon) AllAllocators(ctx sessionctx.Context) autoid.Allocators {
// RebaseAutoID implements table.Table RebaseAutoID interface.
// Both auto-increment and auto-random can use this function to do rebase on explicit newBase value (without shadow bits).
func (t *tableCommon) RebaseAutoID(ctx sessionctx.Context, newBase int64, isSetStep bool, tp autoid.AllocatorType) error {
return t.Allocators(ctx).Get(tp).Rebase(t.tableID, newBase, isSetStep)
// Be care with `Allocator` interface has been refined as `Allocators` in high version.
return t.Allocator(ctx, tp).Rebase(t.tableID, newBase, isSetStep)
}

// Seek implements table.Table Seek interface.
Expand Down

0 comments on commit f6eb817

Please sign in to comment.