eclipse-vertx / vertx-sql-client

High performance reactive SQL Client written in Java
Apache License 2.0
894 stars 200 forks source link

BigDecimal parameters on DB2 #723

Open gavinking opened 4 years ago

gavinking commented 4 years ago

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)
aguibert commented 4 years ago

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

gavinking commented 4 years ago

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 commented 4 years ago

@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.

aguibert commented 4 years ago

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?

gavinking commented 4 years ago

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

Yup.