Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-541

resultSet.relative() behavior is incorrect when crossing result set boundaries

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.0, 1.7.0
    • Component/s: Other
    • 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.

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            yrodiere Yoann Rodiere
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: