Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Done
-
None
-
None
-
None
Description
See github issue
Calling Row.get(…) twice using the same column either fails with IndexOutOfBoundsException or returns an invalid result.
Version: 0.8.0-alpha1
SQL:
|
INSERT INTO legoset (name, manual) VALUES (?, ?)
|
Called Statement.returnGeneratedValues() and then Row.get("ID") |
|
java.lang.IndexOutOfBoundsException: expected: 0 <= start(2) <= start + length(1) <= buf.capacity(2) |
at io.netty.buffer.ByteBufUtil.getBytes(ByteBufUtil.java:884) |
at io.netty.buffer.AbstractByteBuf.getCharSequence(AbstractByteBuf.java:524) |
at io.netty.buffer.AbstractByteBuf.readCharSequence(AbstractByteBuf.java:531) |
at org.mariadb.r2dbc.codec.list.LongCodec.decodeText(LongCodec.java:85) |
at org.mariadb.r2dbc.codec.list.LongCodec.decodeText(LongCodec.java:30) |
at org.mariadb.r2dbc.codec.RowDecoder.get(RowDecoder.java:54) |
at org.mariadb.r2dbc.MariadbRow.decode(MariadbRow.java:93) |
at org.mariadb.r2dbc.MariadbRow.get(MariadbRow.java:49) |
at org.mariadb.r2dbc.MariadbRow.get(MariadbRow.java:57) |
at io.r2dbc.spi.Row.get(Row.java:78) |
at
|
org.springframework.data.r2dbc.convert.MappingR2dbcConverter.potentiallySetId(MappingR2dbcConverter.java:588)
Reproducer:
|
connection.createStatement("INSERT INTO legoset (name, manual) VALUES (?, ?)") |
.bind(0, "Hello") |
.bind(1, 1) |
.returnGeneratedValues()
|
.execute()
|
.flatMap(it -> it.map((row, rowMetadata) -> {
|
|
row.get("id"); |
row.get("ID"); |
return new Object(); |
}))
|
.as(StepVerifier::create)
|
.expectNextCount(1) |
.verifyComplete();
|