Derby
  1. Derby
  2. DERBY-5760

Missing argument in some XJ022 errors

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.9.1.0
    • Fix Version/s: 10.8.3.3, 10.9.1.0
    • Component/s: JDBC
    • Labels:
      None
    • Issue & fix info:
      Patch Available

      Description

      EmbedBlob and EmbedClob some times wrap IOExceptions in an SQLException with SQLState XJ022 (SQLState.SET_STREAM_FAILURE), but they don't always specify the message argument, so the error message ends up like this:

      java.sql.SQLException: Unable to set stream: '

      {0}

      '.

      (The detailed error message does appear in a chained exception, so it's not a very big problem, but it looks a bit odd.)

      I don't know of a way to expose these exceptions in a test. I just noticed it when I added some manual asserts to force a failure when investigating another issue.

      The fix should be simple: Use the helper method Util.setStreamFailure() that sets the message argument automatically.

      1. d5760-1a.diff
        4 kB
        Knut Anders Hatlen

        Issue Links

          Activity

          Hide
          Knut Anders Hatlen added a comment -

          Attaching a patch that makes the three incorrect callers use the helper method instead. All the regression tests ran cleanly with the patch.

          Show
          Knut Anders Hatlen added a comment - Attaching a patch that makes the three incorrect callers use the helper method instead. All the regression tests ran cleanly with the patch.
          Hide
          Knut Anders Hatlen added a comment -

          Committed revision 1341350.

          Show
          Knut Anders Hatlen added a comment - Committed revision 1341350.
          Hide
          Mamta A. Satoor added a comment -

          Will backport this upto 10.8. Assigning temporarily to me during the backport

          Show
          Mamta A. Satoor added a comment - Will backport this upto 10.8. Assigning temporarily to me during the backport
          Hide
          ASF subversion and git services added a comment -

          Commit 1502937 from Mamta A. Satoor
          [ https://svn.apache.org/r1502937 ]

          DERBY-5760(Missing argument in some XJ022 errors)

          Backporting the code contributed by Knut to 10.8

          Show
          ASF subversion and git services added a comment - Commit 1502937 from Mamta A. Satoor [ https://svn.apache.org/r1502937 ] DERBY-5760 (Missing argument in some XJ022 errors) Backporting the code contributed by Knut to 10.8

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development