vertx-sql-client icon indicating copy to clipboard operation
vertx-sql-client copied to clipboard

BigDecimal parameters on DB2

Open gavinking opened this issue 5 years ago • 5 comments

I had to disable this test in Hibernate Reactive on DB2, due to the following error:

 java.lang.IllegalStateException: Found unknown codepoint: 0x220a / 8714
            at io.vertx.db2client.impl.drda.DRDAResponse.throwUnknownCodepoint(DRDAResponse.java:847)
            at io.vertx.db2client.impl.drda.DRDAConnectResponse.parseCommonError(DRDAConnectResponse.java:121)
            at io.vertx.db2client.impl.drda.DRDAQueryResponse.parseExecuteError(DRDAQueryResponse.java:1079)
            at io.vertx.db2client.impl.drda.DRDAQueryResponse.parseEXCSQLSTTreply(DRDAQueryResponse.java:582)
            at io.vertx.db2client.impl.drda.DRDAQueryResponse.readExecute(DRDAQueryResponse.java:238)

gavinking avatar Aug 09 '20 08:08 gavinking

thanks for reporting this one, I'll look into it and at min get the codepoint documented so users get a proper error message.

aguibert avatar Aug 18 '20 15:08 aguibert

Oh, geez, my apologies @aguibert, I just realized that this problem isn't related to batching at all. It's something to do with BigDecimal. I should have looked more closely at the time!

gavinking avatar Aug 18 '20 18:08 gavinking

@aguibert I was able to re-enable the test after making this change:

https://github.com/hibernate/hibernate-reactive/commit/546a22c08af552804c09ad0fa80ba1617207e284

Apparently the driver chokes on certain numerical values of the BigDecimal.

gavinking avatar Aug 18 '20 19:08 gavinking

ah, yea I've spent many hours debugging decimal issues.

Here is the relevant documentation for DB2 decimal number precision: https://www.ibm.com/support/knowledgecenter/SSEPGG_11.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0008469.html

DB2 uses IBM hexadecimal floating point format which is different than IEEE 754 which pretty much everything else uses.

To be clear though, the stacktrace in the OP is what you get when you try to store this certain BigDecimal value?

aguibert avatar Aug 19 '20 02:08 aguibert

the stacktrace in the OP is what you get when you try to store this certain BigDecimal value?

Yup.

gavinking avatar Aug 19 '20 09:08 gavinking