Skip to content

Commit

Permalink
*: remove unnecessary db arg.
Browse files Browse the repository at this point in the history
  • Loading branch information
siddontang committed Oct 30, 2015
1 parent a6f1465 commit 3278e88
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion infoschema/infoschema.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (h *Handle) Set(newInfo []*model.DBInfo, schemaMetaVersion int64) {
info.schemaNameToID[di.Name.L] = di.ID
for _, t := range di.Tables {
alloc := autoid.NewAllocator(h.store, di.ID)
info.tables[t.ID] = table.TableFromMeta(di.Name.L, alloc, t)
info.tables[t.ID] = table.TableFromMeta(alloc, t)
tname := tableName{di.Name.L, t.Name.L}
info.tableNameToID[tname] = t.ID
for _, c := range t.Columns {
Expand Down
2 changes: 1 addition & 1 deletion plan/plans/from_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (p *testFromSuit) SetUpSuite(c *C) {
},
},
}
p.tbl = tables.NewTable(1, "t", "test", p.cols, &simpleAllocator{})
p.tbl = tables.NewTable(1, "t", p.cols, &simpleAllocator{})
variable.BindSessionVars(p)

var i int64
Expand Down
2 changes: 1 addition & 1 deletion plan/plans/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (p *testIndexSuit) SetUpSuite(c *C) {
},
},
}
p.tbl = tables.NewTable(2, "t2", "test", p.cols, &simpleAllocator{})
p.tbl = tables.NewTable(2, "t2", p.cols, &simpleAllocator{})

idxCol := &column.IndexedCol{
IndexInfo: model.IndexInfo{
Expand Down
2 changes: 1 addition & 1 deletion table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ type Table interface {

// TableFromMeta builds a table.Table from *model.TableInfo.
// Currently, it is assigned to tables.TableFromMeta in tidb package's init function.
var TableFromMeta func(schema string, alloc autoid.Allocator, tblInfo *model.TableInfo) Table
var TableFromMeta func(alloc autoid.Allocator, tblInfo *model.TableInfo) Table

// Ident is the table identifier composed of schema name and table name.
// TODO: Move out
Expand Down
6 changes: 3 additions & 3 deletions table/tables/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ type Table struct {
}

// TableFromMeta creates a Table instance from model.TableInfo.
func TableFromMeta(dbname string, alloc autoid.Allocator, tblInfo *model.TableInfo) table.Table {
t := NewTable(tblInfo.ID, tblInfo.Name.O, dbname, nil, alloc)
func TableFromMeta(alloc autoid.Allocator, tblInfo *model.TableInfo) table.Table {
t := NewTable(tblInfo.ID, tblInfo.Name.O, nil, alloc)

for _, colInfo := range tblInfo.Columns {
c := column.Col{ColumnInfo: *colInfo}
Expand All @@ -71,7 +71,7 @@ func TableFromMeta(dbname string, alloc autoid.Allocator, tblInfo *model.TableIn
}

// NewTable constructs a Table instance.
func NewTable(tableID int64, tableName string, dbName string, cols []*column.Col, alloc autoid.Allocator) *Table {
func NewTable(tableID int64, tableName string, cols []*column.Col, alloc autoid.Allocator) *Table {
name := model.NewCIStr(tableName)
t := &Table{
ID: tableID,
Expand Down

0 comments on commit 3278e88

Please sign in to comment.