code: func builtinField(args []types.Datum, ctx context.Context) (d types.Datum, err error) {
  	d.SetInt64(0)
  	if args[0].IsNull() {
  		return
  	}
  	var (
  		pos                  int64
  		allString, allNumber bool
  		newArgs              []types.Datum
  	)
  	allString, allNumber = true, true
  	for i := 0; i < len(args) && (allString || allNumber); i++ {
  		switch args[i].Kind() {
  		case types.KindInt64, types.KindUint64, types.KindFloat32, types.KindFloat64, types.KindMysqlDecimal:
  			allString = false
  		case types.KindString, types.KindBytes:
  			allNumber = false
  		default:
  			allString, allNumber = false, false
  		}
  	}
  	newArgs, err = argsToSpecifiedType(args, allString, allNumber, ctx)
  	if err != nil {
  		return d, errors.Trace(err)
  	}
  	arg0, sc := newArgs[0], ctx.GetSessionVars().StmtCtx
  	for i, curArg := range newArgs[1:] {
  		cmpResult, _ := arg0.CompareDatum(sc, curArg)
  		if cmpResult == 0 {
  			pos = int64(i + 1)
  			break
  		}
  	}
  	d.SetInt64(pos)
  	return d, errors.Trace(err)
  }
docs: // See http://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_field
  // Returns the index (position) of arg0 in the arg1, arg2, arg3, ... list.
  // Returns 0 if arg0 is not found.
  // If arg0 is NULL, the return value is 0 because NULL fails equality comparison with any value.
  // If all arguments are strings, all arguments are compared as strings.
  // If all arguments are numbers, they are compared as numbers.
  // Otherwise, the arguments are compared as double.