db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r539315 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java
Date Fri, 18 May 2007 08:46:51 GMT
Author: kahatlen
Date: Fri May 18 01:46:50 2007
New Revision: 539315

URL: http://svn.apache.org/viewvc?view=rev&rev=539315
Log:
Make JDBC.assertFullResultSet() work on empty result sets.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java?view=diff&rev=539315&r1=539314&r2=539315
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java Fri May 18 01:46:50
2007
@@ -725,9 +725,13 @@
         int rows;
         ResultSetMetaData rsmd = rs.getMetaData();
 
-        // Assert that we have the right number of columns.
-        Assert.assertEquals("Unexpected column count:",
-            expectedRows[0].length, rsmd.getColumnCount());
+        // Assert that we have the right number of columns. If we expect an
+        // empty result set, the expected column count is unknown, so don't
+        // check.
+        if (expectedRows.length > 0) {
+            Assert.assertEquals("Unexpected column count:",
+                expectedRows[0].length, rsmd.getColumnCount());
+        }
 
         for (rows = 0; rs.next(); rows++)
         {



Mime
View raw message