DbmsTypeDefaultImpl implements DbmsTypeDefault { @Override public String applySkipLimit(String originalSql, List<Object> params, long skip, long limit) { requireNonNegative(skip); requireNonNegative(limit); if (skip == 0 && limit == Long.MAX_VALUE) { return originalSql; } final StringBuilder sb = new StringBuilder(originalSql); if (limit == Long.MAX_VALUE) { sb.append(" LIMIT 223372036854775807"); } else { sb.append(" LIMIT ?"); params.add(limit); } if (skip > 0) { sb.append(" OFFSET ?"); params.add(skip); } return sb.toString(); }  @Override String getResultSetTableSchema(); @Override String getSchemaTableDelimiter(); @Override String getInitialQuery(); @Override Set<TypeInfoMetaData> getDataTypes(); @Override Optional<String> getDefaultDbmsName(); @Override DbmsColumnHandler getColumnHandler(); @Override SkipLimitSupport getSkipLimitSupport(); @Override String applySkipLimit(String originalSql, List<Object> params, long skip, long limit); @Override SubSelectAlias getSubSelectAlias(); @Override SortByNullOrderInsertion getSortByNullOrderInsertion();  }
@Test void applySkipLimit() { assertThrows(IllegalArgumentException.class, () -> instance.applySkipLimit("", Collections.emptyList(), -1, -1)); assertThrows(IllegalArgumentException.class, () -> instance.applySkipLimit("", Collections.emptyList(), 1, -1)); final String sql = "SELECT * FROM table"; final List<Object> params = new ArrayList<>(); assertDoesNotThrow(() -> instance.applySkipLimit(sql, params, 1, 1)); assertEquals(sql, instance.applySkipLimit(sql, params, 0, Long.MAX_VALUE)); }