That's definitely a bug in H2.
Do you think you could simplify that into a self-contained test-case?

i.e. something like

CREATE TABLE....
SELECT...


On Fri, Feb 17, 2012 at 17:59, joseaio <[email protected]> wrote:
> The query is:
>                (
>                        SELECT T1.ID AS ID, T1.CURRENCY AS CURRENCY, T1.BOOK 
> AS BOOK,
> T1.OVERDRAFT_LIMIT AS OVERDRAFT_LIMIT, T1.ACCOUNT_ID AS ACCOUNT_ID
>                        FROM BALANCE T1
>                        WHERE T1.BOOK - (
>                                SELECT ISNULL(SUM(AMOUNT),0) FROM ENTRY
>                                WHERE BALANCE_ID = T1.ID
>                                AND SIMPLE_PROCESS_DATE > ?
>                        ) < 0
>                )
>                UNION
>                (
>                        SELECT T1.ID AS ID, T1.CURRENCY AS CURRENCY, T1.BOOK 
> AS BOOK,
> T1.OVERDRAFT_LIMIT AS OVERDRAFT_LIMIT, T1.ACCOUNT_ID AS ACCOUNT_ID
>                        FROM BALANCE T1
>                        INNER JOIN CREDIT_ACCOUNT CA ON CA.ID=T1.ACCOUNT_ID
>                )
>                ORDER BY T1.ACCOUNT_ID
> On Feb 17, 4:50 pm, joseaio <[email protected]> wrote:
>> Caused by: java.lang.NullPointerException at
>> org.h2.command.dml.Query.initOrder(Query.java:357)
>>
>> ************************************
>>
>> Caused by: org.h2.jdbc.JdbcSQLException: General error:
>> "java.lang.NullPointerException" [50000-164]
>>         at org.h2.message.DbException.getJdbcSQLException(DbException.java:
>> 329)
>>         at org.h2.message.DbException.get(DbException.java:158)
>>         at org.h2.message.DbException.convert(DbException.java:281)
>>         at org.h2.message.DbException.toSQLException(DbException.java:254)
>>         at org.h2.message.TraceObject.logAndConvert(TraceObject.java:368)
>>         at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:
>> 639)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
>> 57)
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
>> 43)
>>         at java.lang.reflect.Method.invoke(Method.java:601)
>>         at com.mchange.v2.c3p0.stmt.GooGooStatementCache
>> $1StmtAcquireTask.run(GooGooStatementCache.java:525)
>>         at com.mchange.v2.async.ThreadPoolAsynchronousRunner
>> $PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
>> Caused by: java.lang.NullPointerException
>>         at org.h2.command.dml.Query.initOrder(Query.java:357)
>>         at org.h2.command.dml.SelectUnion.prepare(SelectUnion.java:289)
>>         at org.h2.command.Parser.prepareCommand(Parser.java:218)
>>         at org.h2.engine.Session.prepareLocal(Session.java:415)
>>         at org.h2.engine.Session.prepareCommand(Session.java:364)
>>         at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:
>> 1121)
>>         at
>> org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:
>> 71)
>>         at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:
>> 637)
>>         ... 6 more
>
> --
> You received this message because you are subscribed to the Google Groups "H2 
> Database" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/h2-database?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to