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

stmt.getMoreResults() returns true when it should return false

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.2
    • Fix Version/s: 2.2.0, 1.7.0
    • Component/s: test
    • Labels:
    • Environment:
      Windows running MariaDB 10.2 using mariadb-java-client-2.1.2.jar

      Description

      Calling stmt.getMoreResults() returns true but then subsequently calling stmt.getResultSet() returns null. This is a problem when handing all the resultSets from a stored procedure call that uses select a number of times. Perhaps the number of selects done by the stored procedure might vary from call to call depending on the data so you really want to iterate over them to get them all.
      This bug can be demonstrated by adding assertFalse(stmt.getMoreResults()); to the ends of the procedures stmtMultiResultSets() and prepareStmtMultiResultSets() in src/test/java/org/mariadb/jdbc/CallStatementTest.java
      If you add these two lines then the test fails where it should succeed. I have submitted a pull request to update the test to do these additional checks.
      https://github.com/MariaDB/mariadb-connector-j/pull/116

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            rheylen Richard Heylen
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: