code: func (b *builtinRpadSig) evalString(row chunk.Row) (string, bool, error) {
  	str, isNull, err := b.args[0].EvalString(b.ctx, row)
  	if isNull || err != nil {
  		return "", true, err
  	}
  	runeLength := len([]rune(str))
  
  	length, isNull, err := b.args[1].EvalInt(b.ctx, row)
  	if isNull || err != nil {
  		return "", true, err
  	}
  	targetLength := int(length)
  
  	if uint64(targetLength)*uint64(mysql.MaxBytesOfCharacter) > b.maxAllowedPacket {
  		b.ctx.GetSessionVars().StmtCtx.AppendWarning(errWarnAllowedPacketOverflowed.GenWithStackByArgs("rpad", b.maxAllowedPacket))
  		return "", true, nil
  	}
  
  	padStr, isNull, err := b.args[2].EvalString(b.ctx, row)
  	if isNull || err != nil {
  		return "", true, err
  	}
  	padLength := len([]rune(padStr))
  
  	if targetLength < 0 || targetLength*4 > b.tp.Flen || (runeLength < targetLength && padLength == 0) {
  		return "", true, nil
  	}
  
  	if tailLen := targetLength - runeLength; tailLen > 0 {
  		repeatCount := tailLen/padLength + 1
  		str = str + strings.Repeat(padStr, repeatCount)
  	}
  	return string([]rune(str)[:targetLength]), false, nil
  }
docs: // evalString evals RPAD(str,len,padstr).
  // See https://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_rpad