internal/protocol/field.go
func readDate(rd *bufio.Reader) (int, time.Month, int, bool) {
	year := rd.ReadUint16()
	null := ((year & 0x8000) == 0) //null value
	year &= 0x3fff
	month := rd.ReadInt8()
	month++
	day := rd.ReadInt8()
	return int(year), time.Month(month), int(day), null
}
func readDate(rd *bufio.Reader) (int, time.Month, int, bool) {
	year := rd.ReadUint16()
	null := ((year & 0x8000) == 0) //null value
	year &= 0x3fff
	month := rd.ReadInt8()
	month++
	day := rd.ReadInt8()
	return int(year), time.Month(month), int(day), null
}
func readDate ( rd * bufio . Reader ) ( int , time . Month , int , bool ) { year := rd . ReadUint16 ( ) null := ( ( year & 0x8000 ) == 0 ) //null value year &= 0x3fff month := rd . ReadInt8 ( ) month ++ day := rd . ReadInt8 ( ) return int ( year ) , time . Month ( month ) , int ( day ) , null }
// null values: most sig bit unset
// year: unset second most sig bit (subtract 2^15)
// --> read year as unsigned
// month is 0-based
// day is 1 byte
null values : most sig bit unset year : unset second most sig bit ( subtract 2^15 ) -- > read year as unsigned month is 0 - based day is 1 byte