code: func builtinLeft(args []types.Datum, ctx context.Context) (d types.Datum, err error) {
  	str, err := args[0].ToString()
  	if err != nil {
  		return d, errors.Trace(err)
  	}
  	length, err := args[1].ToInt64(ctx.GetSessionVars().StmtCtx)
  	if err != nil {
  		return d, errors.Trace(err)
  	}
  	l := int(length)
  	if l < 0 {
  		l = 0
  	} else if l > len(str) {
  		l = len(str)
  	}
  	d.SetString(str[:l])
  	return d, nil
  }
docs: // See https://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_left