Skip to content

Commit

Permalink
added getFetchSize()
Browse files Browse the repository at this point in the history
  • Loading branch information
alexradzin committed Apr 17, 2024
1 parent c50eb81 commit 0d963a6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -684,9 +684,8 @@ public void setFetchDirection(int direction) throws SQLException {
}

@Override
@NotImplemented
public int getFetchSize() throws SQLException {
throw new FireboltUnsupportedOperationException();
return 0; // fetch size is not supported; 0 means unlimited like in PostgreSQL and MySQL
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.firebolt.jdbc.annotation.NotImplemented;
import com.firebolt.jdbc.connection.FireboltConnection;
import com.firebolt.jdbc.connection.settings.FireboltProperties;
import com.firebolt.jdbc.exception.ExceptionType;
import com.firebolt.jdbc.exception.FireboltException;
import com.firebolt.jdbc.exception.FireboltSQLFeatureNotSupportedException;
import com.firebolt.jdbc.exception.FireboltUnsupportedOperationException;
Expand Down Expand Up @@ -386,15 +387,15 @@ public int getFetchDirection() throws SQLException {
}

@Override
@ExcludeFromJacocoGeneratedReport
public void setFetchDirection(int direction) throws SQLException {
// no-op
if (direction != ResultSet.FETCH_FORWARD) {
throw new FireboltException(ExceptionType.TYPE_NOT_SUPPORTED);
}
}

@Override
@NotImplemented
public int getFetchSize() throws SQLException {
return 0;
return 0; // fetch size is not supported; 0 means unlimited like in PostgreSQL and MySQL
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ void unsupported() throws SQLException {
void fetchSize() throws SQLException {
inputStream = getInputStreamWithCommonResponseExample();
resultSet = new FireboltResultSet(inputStream, "any_name", "array_db", 65535);
assertThrows(SQLFeatureNotSupportedException.class, () -> resultSet.getFetchSize());
assertEquals(0, resultSet.getFetchSize());

resultSet.setFetchSize(0); // ignored
resultSet.setFetchSize(1); // ignored
Expand Down

0 comments on commit 0d963a6

Please sign in to comment.