Skip to content

Commit

Permalink
model: add isUnsigned for allocator (pingcap#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
XuHuaiyu authored and tiancaiamao committed Nov 12, 2018
1 parent 8ac1198 commit f9ff5ea
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,15 @@ func (t *TableInfo) GetPkColInfo() *ColumnInfo {
return nil
}

func (t *TableInfo) GetAutoIncrementColInfo() *ColumnInfo {
for _, colInfo := range t.Columns {
if mysql.HasAutoIncrementFlag(colInfo.Flag) {
return colInfo
}
}
return nil
}

// Cols returns the columns of the table in public state.
func (t *TableInfo) Cols() []*ColumnInfo {
publicColumns := make([]*ColumnInfo, len(t.Columns))
Expand Down

0 comments on commit f9ff5ea

Please sign in to comment.