code: func builtinFloor(args []types.Datum, ctx context.Context) (d types.Datum, err error) {
  	if args[0].IsNull() ||
  		args[0].Kind() == types.KindUint64 || args[0].Kind() == types.KindInt64 {
  		return args[0], nil
  	}
  
  	// have to set IgnoreTruncate to true in order to getValidPrefix
  	sc := ctx.GetSessionVars().StmtCtx
  	tmpIT := sc.IgnoreTruncate
  	sc.IgnoreTruncate = true
  	f, err := args[0].ToFloat64(sc)
  	if err != nil {
  		sc.IgnoreTruncate = tmpIT
  		return d, errors.Trace(err)
  	}
  
  	sc.IgnoreTruncate = tmpIT
  	d.SetFloat64(math.Floor(f))
  	return
  }
docs: // See http://dev.mysql.com/doc/refman/5.7/en/mathematical-functions.html#function_floor