prestodb/presto · error · SQLException
Invalid argument:
Error message
Invalid argument:
What it means
getMoreResults(int) validates the current argument after checkOpen(): only CLOSE_CURRENT_RESULT, KEEP_CURRENT_RESULT or CLOSE_ALL_RESULTS are legal; any other flag value throws this SQLException before the method proceeds to reject multiple open results.
Source
Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoStatement.java:465
return connection();
}
@Override
public boolean getMoreResults(int current)
throws SQLException
{
checkOpen();
currentUpdateCount.set(-1);
currentUpdateType.set(null);
if (current == CLOSE_CURRENT_RESULT) {
closeResultSet();
return false;
}
if (current != KEEP_CURRENT_RESULT && current != CLOSE_ALL_RESULTS) {
throw new SQLException("Invalid argument: " + current);
}
throw new SQLFeatureNotSupportedException("Multiple open results not supported");
}
@Override
public ResultSet getGeneratedKeys()
throws SQLException
{
throw new SQLFeatureNotSupportedException("getGeneratedKeys");
}
@Override
public int executeUpdate(String sql)
throws SQLException
{
return Ints.saturatedCast(executeLargeUpdate(sql));
}View on GitHub (pinned to 55bb57d202)
Solutions
- Pass only the standard JDBC constants CLOSE_CURRENT_RESULT, KEEP_CURRENT_RESULT or CLOSE_ALL_RESULTS
- Prefer the no-arg getMoreResults() when only the current result should be closed
- Catch SQLException in generic drivers/frameworks that may pass arbitrary flags
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoStatement.java:465 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/1ec5a1814e550d44.
Report an issue: GitHub.