func ColDescFieldNames(full bool) []string {
	if full {
		return []string{"Field", "Type", "Collation", "Null", "Key", "Default", "Extra", "Privileges", "Comment"}
	}
	return []string{"Field", "Type", "Key"}
}
ColDescFieldNames returns the fields name in result set for desc and show columns.
package table
import (
	"strings"
	"github.com/pingcap/parser/mysql"
	"github.com/pingcap/tidb/types"
	"github.com/pingcap/tidb/util/hack"
	"github.com/zhihu/zetta/pkg/model"
)
type Column struct {
	*model.ColumnMeta
}
func (c *Column) String() string {
	return ""
}
func FindCol(cols []*model.ColumnMeta, name string) *model.ColumnMeta {
	for _, col := range cols {
		if strings.EqualFold(col.ColumnMeta.Name, name) {
			return col
		}
	}
	return nil
}
func ToColumn(col *model.ColumnMeta) *Column {
	return &Column{
		col,
	}
}
func truncateTrailingSpaces(v *types.Datum) {
	if v.Kind() == types.KindNull {
		return
	}
	b := v.GetBytes()
	length := len(b)
	for length > 0 && b[length-1] == ' ' {
		length--
	}
	b = b[:length]
	str := string(hack.String(b))
	v.SetString(str, v.Collation())
}
type ColDesc struct {
	Field string
	Type  string
	Key   string
}
const defaultPrivileges = "select,insert,update,references"
func NewColDesc(tbl Table, col *Column) *ColDesc {
	name := col.ColumnMeta.ColumnMeta.Name
	idxName := "null"
	_, idxMeta := tbl.Meta().GetIndexByColumnName(name)
	if idxMeta != nil {
		idxName = idxMeta.Name
	}
	if col.IsPrimary {
		idxName = "primary"
	}
	desc := &ColDesc{
		Field: name,
		Type:  col.GetTypeDesc(),
		Key:   idxName,
	}
	return desc
}
func NewCFDesc(cf *model.ColumnFamilyMeta) *ColDesc {
	return &ColDesc{
		Field: cf.Name,
		Type:  "ColumnFamily",
	}
}
func (c *Column) GetTypeDesc() string {
	desc := c.FieldType.CompactStr()
	if mysql.HasUnsignedFlag(c.Flag) && c.Tp != mysql.TypeBit && c.Tp != mysql.TypeYear {
		desc += " unsigned"
	}
	if mysql.HasZerofillFlag(c.Flag) && c.Tp != mysql.TypeYear {
		desc += " zerofill"
	}
	return desc
}