Skip to content

Commit

Permalink
model: add IsAutoIncColUnsigned for TableInfo (pingcap#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
XuHuaiyu authored Dec 14, 2018
1 parent 3e6c2e7 commit 84a0e63
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,14 @@ func (t *TableInfo) GetAutoIncrementColInfo() *ColumnInfo {
return nil
}

func (t *TableInfo) IsAutoIncColUnsigned() bool {
col := t.GetAutoIncrementColInfo()
if col == nil {
return false
}
return mysql.HasUnsignedFlag(col.Flag)
}

// 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 84a0e63

Please sign in to comment.