Test 'SchoolDbTestRun.testBigDecimal' fails on DerbyDB
Some new test cases were added which DerbyAdapter doesn't pass:
java.lang.RuntimeException: Exception while executing statement : The resulting
value is outside the range for the data type DECIMAL/NUMERIC(31,31).
errorCode: 20000, sqlState: 22003
update "T_Professor" set
"weight_In_B_D" = (((("weight_In_B_D" + ?) - ?) * ?) / ?)
Where
("id" = ?)
at org.squeryl.internals.DatabaseAdapter$class._exec(DatabaseAdapter.scala:315)
at org.squeryl.internals.DatabaseAdapter$class.exec(DatabaseAdapter.scala:365)
at org.squeryl.adapters.DerbyAdapter.exec(DerbyAdapter.scala:23)
at org.squeryl.internals.DatabaseAdapter$class.executeUpdateAndCloseStatement(DatabaseAdapter.scala:377)
at org.squeryl.adapters.DerbyAdapter.executeUpdateAndCloseStatement(DerbyAdapter.scala:23)
at org.squeryl.Table.update(Table.scala:213)
at org.squeryl.dsl.QueryDsl$class.upda...
Leave a comment
The column definition of weight_In_B_D is decimal(20, 16) what looks good. The raw statement in question can be executed in ij without any problem. But when the statement is executed as a prepared statement the exception mentioned in the description is thrown.
Posted a question to the derby mailing list: http://thread.gmane.org/gmane.comp.apache.db.derby.user/13284
Posted a question to the derby mailing list: http://thread.gmane.org/gmane.comp.apache.db.derby.user/13284
on 2011-02-02 22:40 *
By
The query could be re-written as follows to get it working:
--
update "T_Professor" set "weight_In_B_D" = (((("weight_In_B_D" + cast(? as decimal)) - cast(? as decimal)) * cast(? as decimal)) / cast(? decimal) Where ("id" = ?)
--
But I'm not sure whether this is a practicable solution?!?
Filed a derby issue and waiting for response: https://issues.apache.org/jira/browse/DERBY-4998
--
update "T_Professor" set "weight_In_B_D" = (((("weight_In_B_D" + cast(? as decimal)) - cast(? as decimal)) * cast(? as decimal)) / cast(? decimal) Where ("id" = ?)
--
But I'm not sure whether this is a practicable solution?!?
Filed a derby issue and waiting for response: https://issues.apache.org/jira/browse/DERBY-4998
(In revision:a56e004b34bef53f7a291589037d65ec0692cd70) re #7: added BigDecimal test to the ignored list
Branch: 7-mricog
Branch: 7-mricog
on 2011-06-15 18:55 *
By mricog
Assigned to changed from mricog to maxime.levesque
Status changed from Accepted to Test
It looks good to go in the master branch...
(In revision:1dfde22f4aaffc8a729aec5c2b55695e73a668ae) re #7: removed ConnnectionClosingTest for DerbyDB
Branch: master
Branch: master