Skip to content

Commit

Permalink
fix(types): Updating type casting to bools (#74)
Browse files Browse the repository at this point in the history
Updating type casting to bools
  • Loading branch information
Jacobbrewer1 authored Jan 31, 2025
1 parent 8371003 commit 21f8155
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkg/entities/column.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,17 @@ type Column struct {
}

func (c *Column) setTypeInfo(tp *types.FieldType) {
c.Type = tp.EvalType().String()
if tp.GetType() == mysql.TypeLonglong {
switch {
case tp.GetType() == mysql.TypeTiny:
c.Type = "tinyint"
case tp.GetType() == mysql.TypeShort:
c.Type = "smallint"
case tp.GetType() == mysql.TypeInt24:
c.Type = "mediumint"
case tp.GetType() == mysql.TypeLonglong:
c.Type = "bigint"
default:
c.Type = tp.EvalType().String()
}
c.TypeSize = tp.GetFlen()
c.TypePrecision = tp.GetDecimal()
Expand Down

0 comments on commit 21f8155

Please sign in to comment.