code: 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)
  }
docs: // truncateTrailingSpaces trancates trailing spaces for CHAR[(M)] column.
  // fix: https://github.com/pingcap/tidb/issues/3660