eclipse-vertx / vertx-sql-client

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

[MSSQL][DB2] Add support for XML data type #1475

Open DavideD opened 4 days ago

DavideD commented 4 days ago

Based on the documentation, the xml data type is not supported in MSSQL. Example of column definition:

xmlColumn xml

It currently throws (during a select sql query):

Caused by: java.lang.UnsupportedOperationException: Unable to decode typeInfo for XML
    at io.vertx.mssqlclient.impl.codec.DataType.decodeTypeInfo(DataType.java:1065)
    at io.vertx.mssqlclient.impl.codec.MSSQLCommandCodec.handleColumnMetadata(MSSQLCommandCodec.java:120)
    at io.vertx.mssqlclient.impl.codec.MSSQLCommandCodec.decode(MSSQLCommandCodec.java:51)
    at io.vertx.mssqlclient.impl.codec.TdsMessageDecoder.decodeMessage(TdsMessageDecoder.java:75)
    at io.vertx.mssqlclient.impl.codec.TdsMessageDecoder.channelRead(TdsMessageDecoder.java:47)
    at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
    ... 20 more

I've created this issue for SqlServer but Db2 has the same problem.

tsegismont commented 2 days ago

Thanks @DavideD . If we want to support this, we need to decided which Java type can represent XML. Perhaps we need a custom type in Vert.x SQL Clients.