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

Statement.getMoreResults() returns wrong value

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.2.0
    • 1.3.3
    • Other
    • None
    • Debian Jessie, Oracle JDK 8u51, MySQL 5.5.44-0+deb8u1

    Description

      When executing the code below the getMoreResults() method returns true instead of false, while the getResultSet() method returns null and the second call of the getUpdateCount() method returns 1. The used table test has two columns, one "integer" and one "text".

      Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/database?allowMultiQueries=true");
      Statement stmt = connection.createStatement();
      stmt.execute("insert into test values (1, 'one'); insert into test values (2, 'two');");
      int firstCount = stmt.getUpdateCount();
      boolean more = stmt.getMoreResults();
      int secondCount = stmt.getUpdateCount();
      ResultSet secondSet = stmt.getResultSet();

      So in this case firstCount=1, more=true, secondCount=1 and secondSet=null. However, more=false is the correct result. When run using the MySQL Connector/J driver getMoreResults behaves as expected.

      Attachments

        Issue Links

          Activity

            People

              diego dupin Diego Dupin
              konijnendijk Geert Konijnendijk
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.