Derby
  1. Derby
  2. DERBY-4959

NPE in network server trying to return a null LOB as a procedure output arg

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.8.1.2
    • Fix Version/s: 10.8.1.2
    • Component/s: JDBC, Network Server, SQL
    • Labels:
      None
    • Issue & fix info:
      Repro attached
    • Bug behavior facts:
      Crash

      Description

      The server stumbles on the following error if you try to return a null LOB as a procedure output arg:

      java.lang.NullPointerException
      at org.apache.derby.impl.drda.EXTDTAInputStream.length(EXTDTAInputStream.java:280)
      at org.apache.derby.impl.drda.EXTDTAInputStream.isEmptyStream(EXTDTAInputStream.java:274)
      at org.apache.derby.impl.drda.DRDAConnThread.writeFdocaVal(DRDAConnThread.java:7930)
      at org.apache.derby.impl.drda.DRDAConnThread.writeFDODTA(DRDAConnThread.java:7183)
      at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(DRDAConnThread.java:4179)
      at org.apache.derby.impl.drda.DRDAConnThread.processCommands(DRDAConnThread.java:1021)
      at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:294)

      This kills the connection. I will attach a repro.

      1. zz.java
        6 kB
        Rick Hillegas
      2. derby-4959-01-aa-detectNulls.diff
        4 kB
        Rick Hillegas

        Issue Links

          Activity

          Hide
          Rick Hillegas added a comment -

          Tests passed cleanly for me except for the testPing Heisenbug. Committed derby-4959-01-aa-detectNulls.diff at subversion revision 1055676.

          Show
          Rick Hillegas added a comment - Tests passed cleanly for me except for the testPing Heisenbug. Committed derby-4959-01-aa-detectNulls.diff at subversion revision 1055676.
          Hide
          Rick Hillegas added a comment -

          Attaching derby-4959-01-aa-detectNulls.diff. This patch percolates nulls up the call stack when the server is called to wrap a stream around a LOB. I will run regression tests.

          Touches the following files:

          ---------

          M java/drda/org/apache/derby/impl/drda/EXTDTAInputStream.java

          The method which wraps streams around LOB output parameters now detects when the underlying LOB is null.

          ---------

          M java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/CallableStatementTest.java

          New test case for this bug.

          Show
          Rick Hillegas added a comment - Attaching derby-4959-01-aa-detectNulls.diff. This patch percolates nulls up the call stack when the server is called to wrap a stream around a LOB. I will run regression tests. Touches the following files: --------- M java/drda/org/apache/derby/impl/drda/EXTDTAInputStream.java The method which wraps streams around LOB output parameters now detects when the underlying LOB is null. --------- M java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/CallableStatementTest.java New test case for this bug.
          Hide
          Rick Hillegas added a comment -

          Linking to DERBY-4869 because I stumbled across this bug while writing a test case for a patch for that issue.

          Show
          Rick Hillegas added a comment - Linking to DERBY-4869 because I stumbled across this bug while writing a test case for a patch for that issue.
          Hide
          Rick Hillegas added a comment -

          Attaching zz.java, a repro for this bug.

          Show
          Rick Hillegas added a comment - Attaching zz.java, a repro for this bug.

            People

            • Assignee:
              Rick Hillegas
              Reporter:
              Rick Hillegas
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development