Skip to content

Commit

Permalink
[parser] model: add isUnsigned for allocator (pingcap#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
XuHuaiyu authored and xhebox committed Oct 8, 2021
1 parent 0e8df89 commit 5281092
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions parser/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 5281092

Please sign in to comment.