[CONJ-279] Statement#setFetchSize causes infinite loop Created: 2016-04-14  Updated: 2016-04-22  Resolved: 2016-04-22

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 1.4.2
Fix Version/s: 1.4.2

Type: Bug Priority: Major
Reporter: Martin Keller Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None
Environment:

MariaDB Server 10.0.22 on FreeBSD 10.3


Attachments: File mariadb-java-client-1.4.2.tar.gz    

 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();



 Comments   
Comment by Diego Dupin [ 2016-04-14 ]

Hi.

That was the case for 1.4.1, i will let you confirm this, but this has been corrected in 1.4.2.
(That was the reason of the release of 1.4.2 a few hours after 1.4.1).

Comment by Martin Keller [ 2016-04-14 ]

Hi Diego,
I certainly downloaded 1.4.2, but as source code bundle (mariadb-java-client-1.4.2.tar.gz). Maybe there is something wrong with it ? The pom.xml in the archive reports version 1.4.1.

Comment by Diego Dupin [ 2016-04-14 ]

You're right ! the mariadb-java-client-1.4.2.tar.gz link file correspond to the 1.4.1 version.
The 1.4.2 source tar is added to this issue, and link will be corrected

Comment by Martin Keller [ 2016-04-14 ]

Thank you! It works perfectly now.

Comment by Diego Dupin [ 2016-04-22 ]

i just verified, the link is updated

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