NewFieldType returns a FieldType, with a type and other information about field type.
(tp byte)
| 39 | // NewFieldType returns a FieldType, |
| 40 | // with a type and other information about field type. |
| 41 | func NewFieldType(tp byte) *FieldType { |
| 42 | charset1, collate1 := DefaultCharsetForType(tp) |
| 43 | flen, decimal := minFlenAndDecimalForType(tp) |
| 44 | return NewFieldTypeBuilder(). |
| 45 | SetType(tp). |
| 46 | SetCharset(charset1). |
| 47 | SetCollate(collate1). |
| 48 | SetFlen(flen). |
| 49 | SetDecimal(decimal). |
| 50 | BuildP() |
| 51 | } |
| 52 | |
| 53 | // NewFieldTypeWithCollation returns a FieldType, |
| 54 | // with a type and other information about field type. |