Derby
  1. Derby
  2. DERBY-5489

getBinary() returns incorrect data after getObject() call on BLOB column

    Details

    • Urgency:
      Normal
    • Issue & fix info:
      Release Note Needed, Repro attached
    • Bug behavior facts:
      Embedded/Client difference, Wrong query result

      Description

      When ResultSet.getObject(int) is called on a BLOB column, the correct EmbedBlob object is returned. But if afterwards the ResultSet.getBytes(int) is called on the same row, the returned array contains invalid data - it is offset by 3 bytes and its size is incorrect.
      The problem only occurs when the stored BLOB is large enough to be internally represented by stream and not by array of bytes (at least ~32KiB).
      It seems that the getObject method shifts the stream position and therefore the getBytes method starts to read the data after the third byte, thus incorrectly calculating its length.

      1. derby-5489-1a-test.diff
        16 kB
        Kristian Waagan
      2. derby-5489-1b-test.diff
        17 kB
        Kristian Waagan
      3. derby-5489-2a-fixes.diff
        8 kB
        Kristian Waagan
      4. derby-5489-2b-fixes.diff
        20 kB
        Kristian Waagan
      5. releaseNote.html
        3 kB
        Kristian Waagan
      6. repro.diff
        7 kB
        Dag H. Wanvik
      7. SelectBlobBug.java
        0.9 kB
        Pawel Fronczak

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Kristian Waagan
              Reporter:
              Pawel Fronczak
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development