-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.UnsupportedOperationException: Unable to decode metadata for DATETIMN #1040
Comments
Hi @rasmushaglund , thanks for offering your help. You can start by implementing the methods in the If you haven't contributed to Vert.x before, I recommend reading https://github.com/vert-x3/wiki/wiki/Development-Process and https://github.com/vert-x3/wiki/wiki/Vert.x-code-style-guidelines. Looking forward to your contribution! |
Thanks @tsegismont. I assume this is the type documentation? https://docs.microsoft.com/en-us/sql/t-sql/data-types/datetime-transact-sql?view=sql-server-ver15 |
Looks like it
… |
I think I've managed to implemented the type, but I don't know if and how to implement encodeParam. Is there any tests involving encodeParam which I can take a look at? Maybe just try to encode and decode back again and compare the results? |
There's the encodeParam implementation for TIMEN that you can inspire from:
https://github.com/eclipse-vertx/vertx-sql-client/blob/5b6c4cd4d627b1fea28340c2aef0046786e53d9e/vertx-mssql-client/src/main/java/io/vertx/mssqlclient/impl/codec/DataType.java#L451-L457
In the test sources, you should update the classes of the
MSSQLNullableDataTypeTestBase and MSSQLNotNullableDataTypeTestBase
hierarchies,
Le mar. 14 sept. 2021 à 17:45, Rasmus Haglund ***@***.***> a
écrit :
… I think I've managed to implemented the type, but I don't know if and how
to implement encodeParam. Is there any tests involving encodeParam which I
can take a look at? Maybe just try to encode and decode back again and
compare the results?
***@***.***
<rasmushaglund@31278ff>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1040 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALOLNS6OWCRMPXXDTDP7A3UB5U27ANCNFSM5D6CFKAA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I've updated the related tests now, though the problem I have is that the encodeParam function for the data type is not called because the preferred class for LocalDateTime is DATETIME2N: vertx-sql-client/vertx-mssql-client/src/main/java/io/vertx/mssqlclient/impl/codec/DataType.java Line 798 in 5b6c4cd
We have the same problem for DATETIM4. Do we need to create new classes for DATETIMN and DATETIM4 to be able to differentiate between them (since there are no existing java.time classes), or can we just encode those types as DATETIME2N and let SQL Server recast to the correct types? |
This is fine |
Hello, I'm trying out the MSSQL client but encountered an error while trying to decode a nullable datetime field for MSSQL 2017 CU21.
vertx-sql-client/vertx-mssql-client/src/main/java/io/vertx/mssqlclient/impl/codec/DataType.java
Line 395 in 560041b
I debugged the code and saw that there's no metadata handler for the type. I don't fully understand the system here, but when I read an unsigned byte from the payload for the metadata decoding, ByteBufUtils.readUnsignedByteLengthString(payload) gave the correct columnName.
Can I help somehow? If I were about to add support for DATETIMN, what parts of the code would I look into?
The text was updated successfully, but these errors were encountered: