func (d *Datum) GetString() string {
	return hack.String(d.b)
}
GetString gets string value.
package types
import (
	"fmt"
	"math"
	"sort"
	"strconv"
	"strings"
	"time"
	"unicode/utf8"
	"github.com/pingcap/errors"
	"github.com/pingcap/parser/charset"
	"github.com/pingcap/parser/mysql"
	"github.com/pingcap/parser/terror"
	"github.com/pingcap/tidb/sessionctx/stmtctx"
	"github.com/pingcap/tidb/types/json"
	"github.com/pingcap/tidb/util/hack"
	log "github.com/sirupsen/logrus"
)
const (
	KindNull          byte = 0
	KindInt64         byte = 1
	KindUint64        byte = 2
	KindFloat32       byte = 3
	KindFloat64       byte = 4
	KindString        byte = 5
	KindBytes         byte = 6
	KindBinaryLiteral byte = 7  
	KindMysqlDecimal  byte = 8
	KindMysqlDuration byte = 9
	KindMysqlEnum     byte = 10
	KindMysqlBit      byte = 11  
	KindMysqlSet      byte = 12
	KindMysqlTime     byte = 13
	KindInterface     byte = 14
	KindMinNotNull    byte = 15
	KindMaxValue      byte = 16
	KindRaw           byte = 17
	KindMysqlJSON     byte = 18
)
type Datum struct {
	k         byte         
	collation uint8        
	decimal   uint16       
	length    uint32       
	i         int64        
	b         []byte       
	x         interface{}  
}
func (d *Datum) Copy() *Datum {
	ret := *d
	if d.b != nil {
		ret.b = make([]byte, len(d.b))
		copy(ret.b, d.b)
	}
	switch ret.Kind() {
	case KindMysqlDecimal:
		d := *d.GetMysqlDecimal()
		ret.SetMysqlDecimal(&d)
	case KindMysqlTime:
		ret.SetMysqlTime(d.GetMysqlTime())
	}
	return &ret
}
func (d *Datum) Kind() byte {
	return d.k
}
func (d *Datum) Collation() byte {
	return d.collation
}
func (d *Datum) SetCollation(collation byte) {
	d.collation = collation
}
func (d *Datum) Frac() int {
	return int(d.decimal)
}
func (d *Datum) SetFrac(frac int) {
	d.decimal = uint16(frac)
}
func (d *Datum) Length() int {
	return int(d.length)
}
func (d *Datum) SetLength(l int) {
	d.length = uint32(l)
}
func (d *Datum) IsNull() bool {
	return d.k == KindNull
}
func (d *Datum) GetInt64() int64 {
	return d.i
}
func (d *Datum) SetInt64(i int64) {
	d.k = KindInt64
	d.i = i
}
func (d *Datum) GetUint64() uint64 {
	return uint64(d.i)
}
func (d *Datum) SetUint64(i uint64) {
	d.k = KindUint64
	d.i = int64(i)
}
func (d *Datum) GetFloat64() float64 {
	return math.Float64frombits(uint64(d.i))
}
func (d *Datum) SetFloat64(f float64) {
	d.k = KindFloat64
	d.i = int64(math.Float64bits(f))
}
func (d *Datum) GetFloat32() float32 {
	return float32(math.Float64frombits(uint64(d.i)))
}
func (d *Datum) SetFloat32(f float32) {
	d.k = KindFloat32
	d.i = int64(math.Float64bits(float64(f)))
}