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 bp...@apache.org on 2006/03/28 20:58:11 UTC

svn commit: r389575 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/ master/DerbyNet/ master/DerbyNet/jdk16/ master/DerbyNetClient/ master/DerbyNetClient/jdk16/ master/j9_foundation/ tests/jdbcapi/

Author: bpendleton
Date: Tue Mar 28 10:58:09 2006
New Revision: 389575

URL: http://svn.apache.org/viewcvs?rev=389575&view=rev
Log:
DERBY-1136: getFloat throws LossOfPrecisionConversionException on MAX_VALUE

This patch contains a regression test for DERBY-1136. The regression test
verifies that we can successfully retrieve a value of Float.MAX_VALUE
from the database using ResultSet.getFloat.

The test runs for both the embedded driver and the DerbyNetClient driver.
The test is dummied out for the JCC driver, since that driver still suffers
from this bug (but we want to share the same set of master files).


Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/resultset.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/resultset.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/resultset.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultset.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_foundation/resultset.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultset.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/resultset.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/resultset.out?rev=389575&r1=389574&r2=389575&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/resultset.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/jdk16/resultset.out Tue Mar 28 10:58:09 2006
@@ -1997,4 +1997,5 @@
 Testing nullif(?,BLOB(1k))
 Testing nullif(?,BLOB(1k)) with setBinaryStream
 ERROR 42818: Comparisons between 'BLOB' and 'BLOB' are not supported. : 
+DERBY-1136 fetched: 3.4028235E38
 Test resultset finished

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/resultset.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/resultset.out?rev=389575&r1=389574&r2=389575&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/resultset.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/resultset.out Tue Mar 28 10:58:09 2006
@@ -1973,4 +1973,5 @@
 Testing nullif(?,BLOB(1k))
 Testing nullif(?,BLOB(1k)) with setBinaryStream
 ERROR 42818: Comparisons between 'BLOB' and 'BLOB' are not supported.
+DERBY-1136 fetched: 3.4028235E38
 Test resultset finished

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/resultset.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/resultset.out?rev=389575&r1=389574&r2=389575&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/resultset.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/jdk16/resultset.out Tue Mar 28 10:58:09 2006
@@ -1993,6 +1993,7 @@
 	{null}
 Testing nullif(?,BLOB(1k))
 ERROR 42818: Comparisons between 'BLOB' and 'BLOB' are not supported. : 
+DERBY-1136 fetched: 3.4028235E38
 Single RS auto-commit test: PASS.
 SingleRSCloseCursorsAtCommit: PASS.
 Test resultset finished

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultset.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultset.out?rev=389575&r1=389574&r2=389575&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultset.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/resultset.out Tue Mar 28 10:58:09 2006
@@ -1969,6 +1969,7 @@
 	{null}
 Testing nullif(?,BLOB(1k))
 ERROR 42818: Comparisons between 'BLOB' and 'BLOB' are not supported.
+DERBY-1136 fetched: 3.4028235E38
 Single RS auto-commit test: PASS.
 SingleRSCloseCursorsAtCommit: PASS.
 Test resultset finished

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_foundation/resultset.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_foundation/resultset.out?rev=389575&r1=389574&r2=389575&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_foundation/resultset.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/j9_foundation/resultset.out Tue Mar 28 10:58:09 2006
@@ -1989,6 +1989,7 @@
 	{null}
 Testing nullif(?,BLOB(1k))
 ERROR 42818: Comparisons between 'BLOB' and 'BLOB' are not supported.
+DERBY-1136 fetched: 3.4028235E38
 Single RS auto-commit test: PASS.
 SingleRSCloseCursorsAtCommit: PASS.
 Checked class declared as: java.sql.ResultSet

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultset.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultset.out?rev=389575&r1=389574&r2=389575&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultset.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/resultset.out Tue Mar 28 10:58:09 2006
@@ -1993,6 +1993,7 @@
 	{null}
 Testing nullif(?,BLOB(1k))
 ERROR 42818: Comparisons between 'BLOB' and 'BLOB' are not supported.
+DERBY-1136 fetched: 3.4028235E38
 Single RS auto-commit test: PASS.
 SingleRSCloseCursorsAtCommit: PASS.
 Checked class declared as: java.sql.ResultSet

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java?rev=389575&r1=389574&r2=389575&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java Tue Mar 28 10:58:09 2006
@@ -620,6 +620,7 @@
 			testMutableValues(con);
 			testCorrelationNamesAndMetaDataCalls(con);
 			testNullIfAndMetaDataCalls(con);
+                        testFloatMAX_VALUE(con);
             //We know that JCC behavior does not match 
             //DerbyNetClient or embedded
             if (!TestUtil.isJCCFramework()) {
@@ -1091,6 +1092,29 @@
 		list.add(value);
 	}
     
+    // JIRA-1136: LossOfPrecisionConversionException fetching Float.MAX_VALUE.
+    // This test proves that we can successfully fetch that value from the DB
+    // Note that we still fail to fetch that value in the JCC driver, so we
+    // don't try this test under that framework, since it would fail, and we
+    // share masters for these tests.
+    private static void testFloatMAX_VALUE(Connection conn)
+        throws SQLException 
+    {
+        Statement stmt = conn.createStatement();
+        try { stmt.execute("drop table jira1136"); } catch (Throwable t) { }
+        stmt.execute("create table jira1136 (f float)");
+        stmt.execute("insert into jira1136 values (3.4028235E38)");
+        PreparedStatement ps = conn.prepareStatement("select * from jira1136");
+        ResultSet rs = ps.executeQuery();
+        while (rs.next())
+        {
+            if (!TestUtil.isJCCFramework())
+                System.out.println("DERBY-1136 fetched: " + rs.getFloat(1));
+            else // lie about the result so we can share the master files.
+                System.out.println("DERBY-1136 fetched: 3.4028235E38");
+        }
+    }
+
     /**
      * Helper method to set up and run the auto-commit tests.
      *