Uploaded image for project: 'MariaDB Connector/R2DBC'
  1. MariaDB Connector/R2DBC
  2. R2DBC-1

Calling Row.get(…) twice for the same column fails

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Done
    • None
    • 0.8.2-alpha2
    • 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();
      

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 1.5h
                1.5h

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.