List:Commits« Previous MessageNext Message »
From:mmatthews Date:March 13 2008 6:46pm
Subject:Connector/J commit: r6762 - in branches/branch_5_1: . src/com/mysql/jdbc src/testsuite/regression
View as plain text  
Modified:
   branches/branch_5_1/CHANGES
   branches/branch_5_1/src/com/mysql/jdbc/RowDataDynamic.java
   branches/branch_5_1/src/testsuite/regression/StatementRegressionTest.java
Log:
Fixed BUG#35170- ResultSet.isAfterLast() doesn't work with for
	  streaming result sets.

Modified: branches/branch_5_1/CHANGES
===================================================================
--- branches/branch_5_1/CHANGES	2008-03-13 14:05:22 UTC (rev 6761)
+++ branches/branch_5_1/CHANGES	2008-03-13 18:46:04 UTC (rev 6762)
@@ -1,5 +1,11 @@
 # Changelog
 # $Id$
+
+nn-nn-08 - Version 5.1.7
+
+	- Fixed BUG#35170- ResultSet.isAfterLast() doesn't work with for
+	  streaming result sets.
+	  
 03-06-08 - Version 5.1.6
 
     - JDBC-4.0-ized XAConnections and datasources.

Modified: branches/branch_5_1/src/com/mysql/jdbc/RowDataDynamic.java
===================================================================
--- branches/branch_5_1/src/com/mysql/jdbc/RowDataDynamic.java	2008-03-13 14:05:22 UTC (rev 6761)
+++ branches/branch_5_1/src/com/mysql/jdbc/RowDataDynamic.java	2008-03-13 18:46:04 UTC (rev 6762)
@@ -56,7 +56,7 @@
 
 	private boolean isAfterEnd = false;
 
-	private boolean isAtEnd = false;
+	private boolean noMoreRows = false;
 
 	private boolean isBinaryEncoded = false;
 
@@ -409,14 +409,15 @@
 	private void nextRecord() throws SQLException {
 
 		try {
-			if (!this.isAtEnd) {				
+			if (!this.noMoreRows) {				
 				this.nextRow = this.io.nextRow(this.metadata, this.columnCount,
 						this.isBinaryEncoded,
 						java.sql.ResultSet.CONCUR_READ_ONLY, true, 
 						this.useBufferRowExplicit, true, null);
 
 				if (this.nextRow == null) {
-					this.isAtEnd = true;
+					this.noMoreRows = true;
+					this.isAfterEnd = true;
 					this.moreResultsExisted = this.io.tackOnMoreStreamingResults(this.owner);
 
 					if (this.index == -1) {

Modified: branches/branch_5_1/src/testsuite/regression/StatementRegressionTest.java
===================================================================
--- branches/branch_5_1/src/testsuite/regression/StatementRegressionTest.java	2008-03-13 14:05:22 UTC (rev 6761)
+++ branches/branch_5_1/src/testsuite/regression/StatementRegressionTest.java	2008-03-13 18:46:04 UTC (rev 6762)
@@ -5405,4 +5405,27 @@
 		this.rs.close();
 		assertEquals(((com.mysql.jdbc.Connection)fetchConn).getActiveStatementCount(), stmtCount);
 	}
-}
\ No newline at end of file
+	
+	public void testBug35170() throws Exception {
+		Statement stt = null;
+		
+		try {
+			this.conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
+					ResultSet.CONCUR_READ_ONLY);
+			stt.setFetchSize(Integer.MIN_VALUE);
+			this.rs = stt.executeQuery("select 1");
+			this.rs.next();
+			while (!this.rs.isAfterLast()) {
+				this.rs.getString(1);
+				this.rs.next();
+			}
+		} finally {
+			closeMemberJDBCResources();
+			
+			if (stt != null) {
+				stt.close();
+			}
+		}
+				
+	}
+ } 
\ No newline at end of file

Thread
Connector/J commit: r6762 - in branches/branch_5_1: . src/com/mysql/jdbc src/testsuite/regressionmmatthews13 Mar