code: func builtinLeast(args []types.Datum, ctx context.Context) (d types.Datum, err error) {
  	if args[0].IsNull() {
  		return
  	}
  	min := 0
  	sc := ctx.GetSessionVars().StmtCtx
  	for i := 1; i < len(args); i++ {
  		if args[i].IsNull() {
  			return
  		}
  
  		var cmp int
  		if cmp, err = args[i].CompareDatum(sc, args[min]); err != nil {
  			return
  		}
  
  		if cmp < 0 {
  			min = i
  		}
  	}
  	d = args[min]
  	return
  }
docs: // See http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#function_least