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

Statement#setFetchSize causes infinite loop

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.4.2
    • 1.4.2
    • Other
    • None
    • MariaDB Server 10.0.22 on FreeBSD 10.3

    Description

      Using Statement setFetchSize causes ResultSet#getNext to return always true.
      To reproduce the bug the following code snippet can be used.

      Statement stmt;
      ResultSet rs;

      stmt = null;
      rs = null;

      stmt = conn.createStatement();

      stmt.execute("DROP TABLE IF EXISTS TEST");
      stmt.execute("CREATE TABLE TEST (MYID INTEGER NOT NULL PRIMARY KEY, MYTEXT VARCHAR(20))");

      stmt.execute("INSERT INTO TEST VALUES(1, 'test1')");
      stmt.setFetchSize(10);

      rs = stmt.executeQuery("SELECT MYID, MYTEXT FROM TEST");

      while (rs.next())

      { System.out.println(rs.getString(2)); }

      rs.close();

      stmt.execute("DROP TABLE TEST");

      stmt.close();

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            martin.keller.up Martin Keller
            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.