Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
According to the documentation for ResultSet#next:
When a call to the next method returns false, the cursor is positioned after the last row. Any invocation of a ResultSet method which requires a current row will result in a SQLException being thrown. If the result set type is TYPE_FORWARD_ONLY, it is vendor specified whether their JDBC driver implementation *will return false or throw an SQLException on a subsequent call to next.*
In JDBCInterpreter getResults method is iterating till it reaches the max limit or next() returns false.
In executeSql that calls getResults the next() method is called again. According to the JDBC specification this may produce SQL Exception if end of the result set is already reached.
That may be reproducible with Apache Phoenix 4.7+ jdbc driver.