You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dy...@apache.org on 2013/10/14 13:12:47 UTC

svn commit: r1531854 - in /db/derby/code/trunk/java: client/org/apache/derby/client/am/ClientResultSet.java engine/org/apache/derby/impl/jdbc/EmbedResultSet.java testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StatementJdbc20Test.java

Author: dyre
Date: Mon Oct 14 11:12:46 2013
New Revision: 1531854

URL: http://svn.apache.org/r1531854
Log:
DERBY-3573: Remove incorrect check against maxRows when setting fetchSize. Patch contributed by Nirmal Fernando.

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientResultSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StatementJdbc20Test.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientResultSet.java?rev=1531854&r1=1531853&r2=1531854&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientResultSet.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientResultSet.java Mon Oct 14 11:12:46 2013
@@ -2720,7 +2720,7 @@ public abstract class ClientResultSet im
                     agent_.logWriter_.traceEntry(this, "setFetchSize", rows);
                 }
                 checkForClosedResultSet("setFetchSize");
-                if (rows < 0 || (maxRows_ != 0 && rows > maxRows_)) {
+                if (rows < 0) {
                     throw new SqlException(agent_.logWriter_, 
                         new ClientMessageId(SQLState.INVALID_FETCH_SIZE),
                         rows).getSQLException();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java?rev=1531854&r1=1531853&r2=1531854&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java Mon Oct 14 11:12:46 2013
@@ -2292,11 +2292,11 @@ public class EmbedResultSet extends Conn
 	 *            the number of rows to fetch
 	 * @exception SQLException
 	 *                if a database-access error occurs, or the condition 0 <=
-	 *                rows <= this.getMaxRows() is not satisfied.
+	 *                rows is not satisfied.
 	 */
 	public void setFetchSize(int rows) throws SQLException {
 		checkIfClosed("setFetchSize");
-		if (rows < 0 || (stmt.getMaxRows() != 0 && rows > stmt.getMaxRows())) {
+		if (rows < 0) {
 			throw Util.generateCsSQLException(SQLState.INVALID_FETCH_SIZE,
 					new Integer(rows));
 		} else if (rows > 0) // if it is zero ignore the call

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StatementJdbc20Test.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StatementJdbc20Test.java?rev=1531854&r1=1531853&r2=1531854&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StatementJdbc20Test.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/StatementJdbc20Test.java Mon Oct 14 11:12:46 2013
@@ -196,13 +196,9 @@ public class StatementJdbc20Test extends
         assertEquals(rs.getFetchSize(), 250);
         assertEquals(rs.getFetchDirection(), ResultSet.FETCH_REVERSE);
         
-        // exception conditions
+        // Verify that fetch size can be set larger than maxRows
         stmt.setMaxRows(10);
-        try{
-            rs.setFetchSize(100);
-        } catch(SQLException e){
-            assertSQLState("XJ062", e);
-        }
+        rs.setFetchSize(100);
         
         //Error  testing  : set wrong values ..
         try{