Skip to content

Commit

Permalink
[parser] model: add isUnsigned for allocator (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
XuHuaiyu authored and ti-chi-bot committed Oct 9, 2021
1 parent 027ca88 commit 8c54ae8
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 8c54ae8

Please sign in to comment.