code: func (b *builtinLeastTimeSig) evalString(row chunk.Row) (res string, isNull bool, err error) {
  	var (
  		v string
  		t types.Time
  	)
  	min := types.Time{
  		Time: types.MaxDatetime,
  		Type: mysql.TypeDatetime,
  		Fsp:  types.MaxFsp,
  	}
  	findInvalidTime := false
  	sc := b.ctx.GetSessionVars().StmtCtx
  	for i := 0; i < len(b.args); i++ {
  		v, isNull, err = b.args[i].EvalString(b.ctx, row)
  		if isNull || err != nil {
  			return "", true, err
  		}
  		t, err = types.ParseDatetime(sc, v)
  		if err != nil {
  			if err = handleInvalidTimeError(b.ctx, err); err != nil {
  				return v, true, err
  			} else if !findInvalidTime {
  				res = v
  				findInvalidTime = true
  			}
  		}
  		if t.Compare(min) < 0 {
  			min = t
  		}
  	}
  	if !findInvalidTime {
  		res = min.String()
  	}
  	return res, false, nil
  }
docs: // evalString evals a builtinLeastTimeSig.
  // See http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#functionleast