Hello,
When the following SQL requests, a classcast exception occurs on the server side, for instance using sqltool:
CREATE TABLE T ( V DECIMAL(28) NOT NULL, ); SELECT MAX(V) + 1 FROM T UNION SELECT COUNT(*) + 1 FROM T;
On the hsqldb server logs:
2015-03-03 13:06:49.706 3 SELECT MAX(V) + 1 FROM T UNION SELECT COUNT(*) + 1 FROM T java.lang.ClassCastException: java.lang.Long cannot be cast to java.math.BigDecimal at org.hsqldb.rowio.RowOutputBase.writeData(RowOutputBase.java:232) at org.hsqldb.rowio.RowOutputBinary.writeData(RowOutputBinary.java:1) at org.hsqldb.rowio.RowOutputBase.writeData(RowOutputBase.java:187) at org.hsqldb.rowio.RowOutputBinary.writeData(RowOutputBinary.java:1) at org.hsqldb.navigator.RowSetNavigatorData.write(RowSetNavigatorData.java:317) at org.hsqldb.result.Result.write(Result.java:1269) at org.hsqldb.server.ServerConnection.receiveResult(ServerConnection.java:402) at org.hsqldb.server.ServerConnection.run(ServerConnection.java:1533) at java.lang.Thread.run(Thread.java:745)
I am using the last snapshot from svn, but it is reproducible with the 2.3.2.
Best regards,
Thanks. Has been fixed and committed to SVN.
Thank you for the quick reply! Still, I have updated to the last snapshot from trunk [5430] but the problem remains. Could you please check?
It works fine here. Some changes to org.hsqldb.QuerySpecification were required.
Oups. It was my fault. I have just rechecked and I may been tricked by Eclipse. Many thanks for the support!