Skip to content
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

io.vertx.core.buffer.impl.BufferImpl cannot be coerced to io.netty.buffer.ByteBuf in Db2 #1304

Closed
DavideD opened this issue Apr 4, 2023 · 3 comments
Assignees
Milestone

Comments

@DavideD
Copy link
Contributor

DavideD commented Apr 4, 2023

Given the table:

create table Basic (id integer not null, uuid char(16) for bit data, primary key (id))

If I try to insert an element with the query:

insert into Basic (uuid,id) values (?,?)

and parameters:

0 = {BufferImpl@9246} "�>Eg�BӤVUfBD
1 = {Integer@9247} "�>1

I get:

Parameter at position[0] with class = [io.vertx.core.buffer.impl.BufferImpl] and value = [>Eg�BӤVUfBD] can not be coerced to the expected class = [io.netty.buffer.ByteBuf] for encoding.

The parameters is created using

byte[] x = ...
io.vertx.core.buffer.Buffer.buffer( x )

Note that this approach works for all the other databases.

@DavideD DavideD added the bug label Apr 4, 2023
DavideD added a commit to DavideD/hibernate-reactive that referenced this issue Apr 4, 2023
Tests throw exception:
```
Parameter at position[0] with class = [io.vertx.core.buffer.impl.BufferImpl] and value = [>Eg�BӤVUfBD] can not be coerced to the expected class = [io.netty.buffer.ByteBuf] for encoding.
```

See eclipse-vertx/vertx-sql-client#1304
DavideD added a commit to DavideD/hibernate-reactive that referenced this issue Apr 4, 2023
Tests throw exception:
```
Parameter at position[0] with class = [io.vertx.core.buffer.impl.BufferImpl] and value = [>Eg�BӤVUfBD] can not be coerced to the expected class = [io.netty.buffer.ByteBuf] for encoding.
```

See eclipse-vertx/vertx-sql-client#1304
DavideD added a commit to DavideD/hibernate-reactive that referenced this issue Apr 4, 2023
Tests throw exception:
```
Parameter at position[0] with class = [io.vertx.core.buffer.impl.BufferImpl] and value = [>Eg�BӤVUfBD] can not be coerced to the expected class = [io.netty.buffer.ByteBuf] for encoding.
```

See eclipse-vertx/vertx-sql-client#1304
DavideD added a commit to DavideD/hibernate-reactive that referenced this issue Apr 4, 2023
Tests throw exception:
```
Parameter at position[0] with class = [io.vertx.core.buffer.impl.BufferImpl] and value = [>Eg�BӤVUfBD] can not be coerced to the expected class = [io.netty.buffer.ByteBuf] for encoding.
```

See eclipse-vertx/vertx-sql-client#1304
@tsegismont tsegismont added this to the 4.4.2 milestone Apr 11, 2023
@tsegismont tsegismont changed the title io.netty.buffer.ByteBuf cannot be coerced to io.vertx.core.buffer.impl.BufferImpl in Db2 io.vertx.core.buffer.impl.BufferImpl cannot be coerced to io.netty.buffer.ByteBuf in Db2 Apr 11, 2023
tsegismont added a commit to tsegismont/vertx-sql-client that referenced this issue Apr 11, 2023
@tsegismont
Copy link
Contributor

@DavideD PR #1307 should fix this

Note that if you use CHAR(N) FOR BIT DATA column and the value is smaller than N bytes, DB2 will fill the remaining bits with space (32).

tsegismont added a commit that referenced this issue Apr 11, 2023
tsegismont added a commit that referenced this issue Apr 11, 2023
@tsegismont
Copy link
Contributor

Fixed in 634100d

@DavideD
Copy link
Contributor Author

DavideD commented Apr 11, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants