Right now I can't figure out where this would need fixing. Attaching diff for 
test-case in case Thomas has some time.

diff --git a/h2/src/test/org/h2/test/db/TestFunctions.java 
b/h2/src/test/org/h2/test/db/TestFunctions.java
index afdd5f7..d9919b4 100644
--- a/h2/src/test/org/h2/test/db/TestFunctions.java
+++ b/h2/src/test/org/h2/test/db/TestFunctions.java
@@ -36,7 +36,6 @@
 import java.util.Properties;
 import java.util.TimeZone;
 import java.util.UUID;
-
 import org.h2.api.Aggregate;
 import org.h2.api.AggregateFunction;
 import org.h2.api.ErrorCode;
@@ -106,6 +105,7 @@
         testGenerateSeries();
         testFileWrite();
         testAnnotationProcessorsOutput();
+        testIfNull();

         deleteDb("functions");
     }
@@ -1781,6 +1781,24 @@
         conn.close();
     }

+    private void testIfNull() throws SQLException {
+        Connection conn = getConnection("functions");
+        Statement stat = 
conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, 
ResultSet.CONCUR_READ_ONLY);
+
+        stat.execute("CREATE TABLE T(f1 double)");
+        stat.executeUpdate("INSERT INTO T VALUES( 1.2 )");
+        stat.executeUpdate("INSERT INTO T VALUES( null )");
+        ResultSet rs = stat.executeQuery("SELECT IFNULL(f1, 0.0) FROM T");
+        ResultSetMetaData metaData = rs.getMetaData();
+        assertEquals("java.lang.Double", metaData.getColumnClassName(1));
+        rs.next();
+        assertEquals("java.lang.Double", rs.getObject(1).getClass().getName());
+        rs.next();
+        assertEquals("java.lang.Double", rs.getObject(1).getClass().getName());
+
+        conn.close();
+    }
+
     private void testAnnotationProcessorsOutput() throws SQLException {
         testAnnotationProcessorsOutput_emptyKey();
         testAnnotationProcessorsOutput_invalidKey();

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to