[CONJ-541] resultSet.relative() behavior is incorrect when crossing result set boundaries Created: 2017-10-26  Updated: 2017-11-07  Resolved: 2017-11-07

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: None
Fix Version/s: 2.2.0, 1.7.0

Type: Bug Priority: Major
Reporter: Yoann Rodiere Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None


 Description   

When going forward (positive offset), reaching the position just after the last row will make relative() return true (as if the result set was positioned on a row).

When going backward (negative offset), trying to reach a row before the first will never work: the result set will appear "stuck" on the first row.

According to the ResultSet interface's Javadoc (java.sql.ResultSet#relative):

Attempting to move beyond the first/last row in the
result set positions the cursor before/after the
the first/last row.

And:

@return <code>true</code> if the cursor is on a row; <code>false</code> otherwise

So the current behavior is incorrect.

PR with test cases (and hopefully a fix) coming soon.



 Comments   
Comment by Yoann Rodiere [ 2017-10-26 ]

Pull request with tests and fix on GitHub: https://github.com/MariaDB/mariadb-connector-j/pull/115

Generated at Thu Feb 08 03:16:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.