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

Clob.truncate(0) throws exception

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.3.3.1, 10.4.2.1, 10.6.1.0
    • Fix Version/s: 10.4.2.1, 10.5.2.0, 10.6.1.0
    • Component/s: JDBC
    • Labels:
      None
    • Issue & fix info:
      Newcomer, Release Note Needed
    • Bug behavior facts:
      Deviation from standard

      Description

      Truncating a Clob to zero length is allowed according to the JDBC specification, which says the following about the len argument (in the @throws tag):
      "SQLException - if there is an error accessing the CLOB value or if len is less than 0 "

      Derby throws an exception if zero is passed to truncate.

      A quick inspection of the code suggests that truncating a Clob to the empty string is easy to support.

        Attachments

        1. releaseNote.html
          5 kB
          Kristian Waagan
        2. releaseNote.html
          4 kB
          Yun Lee
        3. releaseNote.html
          4 kB
          Myrna van Lunteren
        4. derby-3991-3.stat
          0.1 kB
          Yun Lee
        5. derby-3991-3.releaseNote.html
          4 kB
          Yun Lee
        6. derby-3991-3.diff
          3 kB
          Yun Lee
        7. derby-3991-2a.diff
          3 kB
          Yun Lee
        8. derby-3991-1a-ClobTruncateZeroTest.diff
          2 kB
          Kristian Waagan

          Activity

            People

            • Assignee:
              yunlee Yun Lee
              Reporter:
              kristwaa Kristian Waagan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: