code: func NewColDesc(col *Column) *ColDesc {
  	// TODO: if we have no primary key and a unique index which's columns are all not null
  	// we will set these columns' flag as PriKeyFlag
  	// see https://dev.mysql.com/doc/refman/5.7/en/show-columns.html
  	// create table
  	name := col.Name
  	nullFlag := "YES"
  	if mysql.HasNotNullFlag(col.Flag) {
  		nullFlag = "NO"
  	}
  	keyFlag := ""
  	if mysql.HasPriKeyFlag(col.Flag) {
  		keyFlag = "PRI"
  	} else if mysql.HasUniKeyFlag(col.Flag) {
  		keyFlag = "UNI"
  	} else if mysql.HasMultipleKeyFlag(col.Flag) {
  		keyFlag = "MUL"
  	}
  	var defaultValue interface{}
  	if !mysql.HasNoDefaultValueFlag(col.Flag) {
  		defaultValue = col.GetDefaultValue()
  	}
  
  	extra := ""
  	if mysql.HasAutoIncrementFlag(col.Flag) {
  		extra = "auto_increment"
  	} else if mysql.HasOnUpdateNowFlag(col.Flag) {
  		extra = "on update CURRENT_TIMESTAMP"
  	} else if col.IsGenerated() {
  		if col.GeneratedStored {
  			extra = "STORED GENERATED"
  		} else {
  			extra = "VIRTUAL GENERATED"
  		}
  	}
  
  	desc := &ColDesc{
  		Field:        name.O,
  		Type:         col.GetTypeDesc(),
  		Charset:      col.Charset,
  		Collation:    col.Collate,
  		Null:         nullFlag,
  		Key:          keyFlag,
  		DefaultValue: defaultValue,
  		Extra:        extra,
  		Privileges:   defaultPrivileges,
  		Comment:      col.Comment,
  	}
  	if !field_types.HasCharset(&col.ColumnInfo.FieldType) {
  		desc.Charset = nil
  		desc.Collation = nil
  	}
  	return desc
  }
docs: // NewColDesc returns a new ColDesc for a column.