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

Implement error handling/parameter checking in Clob.setString

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.3.1.4
    • 10.6.1.0
    • JDBC
    • None
    • Normal
    • Newcomer, Release Note Needed

    Description

      The error handling, or parameter checking, in Clob.subString is not adequate.
      There are four parameters that can be invalid;

      • pos
      • str
      • offset
      • len

      The first one is already handled properly, the remaining three are not. They typically result in some low-level exception like a NPE.
      I have not found anything in the JDBC specification nor JavaDoc that dictates the behavior, except for that SQLException should use states defined in the SQL 2003 specification. A brief search there resulted in the following possibilities:
      22003 - numeric value out of range
      22004 - null value not allowed
      2200F - zero-length character string
      22011 - substring error
      22023 - invalid parameter value

      Some of these are already defined by Derby, but with unsuitable or very specific error messages.

      Attachments

        1. DERBY-2769-1.patch
          5 kB
          Yun Lee
        2. DERBY-2769-1.stat
          0.2 kB
          Yun Lee
        3. DERBY-2769-2.patch
          5 kB
          Yun Lee
        4. DERBY-2769-2.stat
          0.2 kB
          Yun Lee
        5. DERBY-2769-3-a.diff
          7 kB
          Yun Lee
        6. DERBY-2769-3-a.stat
          0.2 kB
          Yun Lee
        7. DERBY-2769-3-b.diff
          5 kB
          Yun Lee
        8. DERBY-2769-3-b.stat
          0.3 kB
          Yun Lee
        9. DERBY-2769-4.diff
          10 kB
          Yun Lee
        10. DERBY-2769-4.stat
          0.4 kB
          Yun Lee
        11. releaseNote.html
          5 kB
          Kristian Waagan
        12. releaseNote.html
          5 kB
          Kristian Waagan
        13. releaseNote.html
          5 kB
          Yun Lee

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: