Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-4040

SQLChar.getLength returns wrong length for some data values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.3.3.1, 10.4.2.0, 10.5.1.1
    • 10.3.3.1, 10.4.2.1, 10.5.1.1
    • SQL
    • None
    • Regression, Wrong query result

    Description

      SQLChar.getLength() returns the wrong length of the data value in some cases.
      For the bug to be triggered, the value must contain characters that are represented by two or three bytes, and Derby must store the value as a stream.

      In my ad-hoc testing, I found that a value of length 10886 with CJK characters doesn't trigger the bug, but 10887 does trigger the bug. Further, for a range of lengths the bug can also been observed for CLOB columns (when doing 'select length(clobcolumn)').

      Attachments

        1. derby-4040-2a-backport.diff
          8 kB
          Kristian Waagan
        2. derby-4040-1a-SQLChar_length_and_test.stat
          0.2 kB
          Kristian Waagan
        3. derby-4040-1a-SQLChar_length_and_test.diff
          9 kB
          Kristian Waagan

        Issue Links

          Activity

            People

              kristwaa Kristian Waagan
              kristwaa Kristian Waagan
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: