code: func getUintForLimitOffset(sc *variable.StatementContext, val interface{}) (uint64, error) {
  	switch v := val.(type) {
  	case uint64:
  		return v, nil
  	case string:
  		uVal, err := types.StrToUint(sc, v)
  		return uVal, errors.Trace(err)
  	}
  	return 0, errors.Errorf("Invalid type %T for Limit/Offset", val)
  }
docs: // getUintForLimitOffset gets uint64 value for limit/offset.
  // For ordinary statement, limit/offset should be uint64 constant value.
  // For prepared statement, limit/offset is string. We should convert it to uint64.