{"record":{"id":"1ec5a1814e550d44","repo":"prestodb/presto","slug":"invalid-argument","errorCode":null,"errorMessage":"Invalid argument: ","messagePattern":"Invalid argument: ","errorType":"validation","errorClass":"SQLException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoStatement.java","lineNumber":465,"sourceCode":"        return connection();\n    }\n\n    @Override\n    public boolean getMoreResults(int current)\n            throws SQLException\n    {\n        checkOpen();\n\n        currentUpdateCount.set(-1);\n        currentUpdateType.set(null);\n\n        if (current == CLOSE_CURRENT_RESULT) {\n            closeResultSet();\n            return false;\n        }\n\n        if (current != KEEP_CURRENT_RESULT && current != CLOSE_ALL_RESULTS) {\n            throw new SQLException(\"Invalid argument: \" + current);\n        }\n\n        throw new SQLFeatureNotSupportedException(\"Multiple open results not supported\");\n    }\n\n    @Override\n    public ResultSet getGeneratedKeys()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getGeneratedKeys\");\n    }\n\n    @Override\n    public int executeUpdate(String sql)\n            throws SQLException\n    {\n        return Ints.saturatedCast(executeLargeUpdate(sql));\n    }","sourceCodeStart":447,"sourceCodeEnd":483,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoStatement.java#L447-L483","documentation":"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.","triggerScenarios":"Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoStatement.java:465 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}