code: func builtinIf(args []types.Datum, ctx context.Context) (d types.Datum, err error) {
  	// if(expr1, expr2, expr3)
  	// if expr1 is true, return expr2, otherwise, return expr3
  	v1 := args[0]
  	v2 := args[1]
  	v3 := args[2]
  
  	if v1.IsNull() {
  		return v3, nil
  	}
  
  	b, err := v1.ToBool(ctx.GetSessionVars().StmtCtx)
  	if err != nil {
  		d := types.Datum{}
  		return d, errors.Trace(err)
  	}
  
  	// TODO: check return type, must be numeric or string
  	if b == 1 {
  		return v2, nil
  	}
  
  	return v3, nil
  }
docs: // See https://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html#function_if