Re: [h2] Metadata and actual values column class mismatch

2016-03-02 Thread Christopher Deckers
Hi Thomas, I will test this patch and commit it if I don't find problems. > Thanks! Please let me know when it is committed so I can do further testing on my end. Cheers, -Christopher -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubsc

Re: [h2] Metadata and actual values column class mismatch

2016-02-08 Thread Thomas Mueller
Hi, Yes, it looks like a bug, a possible patch is (excluding the test case): --- a/h2/src/main/org/h2/expression/Function.java +++ b/h2/src/main/org/h2/expression/Function.java @@ -965,6 +965,7 @@ public class Function extends Expression implements FunctionCall { if (v0 == ValueNull.

Re: [h2] Metadata and actual values column class mismatch

2016-02-08 Thread Christopher Deckers
Noel, Thomas, By any chance, did you have some time to look into this metadata type issue? Cheers, -Christopher -- 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

Re: [h2] Metadata and actual values column class mismatch

2015-11-17 Thread Noel Grandin
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/TestFun

Re: [h2] Metadata and actual values column class mismatch

2015-11-16 Thread Noel Grandin
Hi Ah, yes, you are correct, this is indeed a bug. I will investigate further. Regards, Noel -- 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 h2-database+unsubs

Re: [h2] Metadata and actual values column class mismatch

2015-11-16 Thread Christopher Deckers
Hi Noel, By default constant values are interpreted as decimal. If you want them to > be doubles, you will need to explicitly cast them I don't mind the constants to return a decimal, but then metadata should not lie about the type that is returned. Don't you think it is a bug that a decimal is

Re: [h2] Metadata and actual values column class mismatch

2015-11-16 Thread Noel Grandin
Hi By default constant values are interpreted as decimal. If you want them to be doubles, you will need to explicitly cast them like so: SELECT IFNULL(f1, CAST(0.0 AS DOUBLE)) FROM T Regards, Noel -- You received this message because you are subscribed to the Google Groups "H2 Database" g

[h2] Metadata and actual values column class mismatch

2015-11-11 Thread Christopher Deckers
Hi all, We found a case where metadata from a resultset declares a column class (a "java.lang.Double") but a value happens to not match (it is a "java.math.BigDecimal"). We base some logic on these column classes (like sorting in UI), and our code breaks (class cast exceptions). The culprit se