Derby
  1. Derby
  2. DERBY-4544

Referencing streaming CLOBs in (some) generated column clauses fails

    Details

    • Urgency:
      Low
    • Issue & fix info:
      Patch Available, Repro attached
    • Bug behavior facts:
      Data corruption

      Description

      Referencing a CLOB represented as a stream in generated columns can lead to data corruption or that the query fails.

      For instance, with 10.5:
      create table t (id int, myclob clob, clen generated always as (length(myclob)));

      1. Insert CLOB using the streaming APIs (setCharacterStream).
        The exception 'java.lang.ClassCastException: org.apache.derby.iapi.types.ReaderToUTF8Stream cannot be cast to org.apache.derby.iapi.types.Resetable'

      On trunk the same query results in data corruption, and this isn't detected before the value is read back from store.

      Workaround:
      Don't use the streaming APIs when using CLOBs in generated columns. This increases the memory footprint, and may not feasible for large CLOBs.

      FYI, BLOB deals with this by materializing the value, which effectively equals to using the workaround mentioned above.

      1. Test_4544.java
        3 kB
        Rick Hillegas
      2. Test_4544.java
        4 kB
        Rick Hillegas
      3. derby-4544-01-ab-shortCircuitLengthOptimization.diff
        5 kB
        Rick Hillegas
      4. Test_4544.java
        8 kB
        Rick Hillegas
      5. derby-4544-01-ac-shortCircuitLengthOptimization.diff
        9 kB
        Rick Hillegas

        Issue Links

          Activity

          Kristian Waagan created issue -
          Kristian Waagan made changes -
          Field Original Value New Value
          Assignee Kristian Waagan [ kristwaa ]
          Kristian Waagan made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Kristian Waagan made changes -
          Status In Progress [ 3 ] Open [ 1 ]
          Kristian Waagan made changes -
          Labels CLOB
          Rick Hillegas made changes -
          Link This issue is related to DERBY-4754 [ DERBY-4754 ]
          Dag H. Wanvik made changes -
          Labels CLOB CLOB derby_triage10_8
          Urgency Low
          Rick Hillegas made changes -
          Attachment Test_4544.java [ 12475613 ]
          Rick Hillegas made changes -
          Issue & fix info [Repro attached]
          Rick Hillegas made changes -
          Attachment Test_4544.java [ 12476000 ]
          Rick Hillegas made changes -
          Rick Hillegas made changes -
          Issue & fix info [Repro attached] [Patch Available, Repro attached]
          Rick Hillegas made changes -
          Attachment Test_4544.java [ 12476010 ]
          Rick Hillegas made changes -
          Rick Hillegas made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 10.8.1.1 [ 12316356 ]
          Fix Version/s 10.9.0.0 [ 12316344 ]
          Resolution Fixed [ 1 ]
          Rick Hillegas made changes -
          Fix Version/s 10.8.1.2 [ 12316362 ]
          Fix Version/s 10.8.1.1 [ 12316356 ]
          Kristian Waagan made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Assignee Kristian Waagan [ kristwaa ] Rick Hillegas [ rhillegas ]
          Kristian Waagan made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Kathey Marsden made changes -
          Link This issue is required by DERBY-5654 [ DERBY-5654 ]
          Kathey Marsden made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Mike Matrigali made changes -
          Assignee Rick Hillegas [ rhillegas ] Mike Matrigali [ mikem ]
          Mike Matrigali made changes -
          Assignee Mike Matrigali [ mikem ] Rick Hillegas [ rhillegas ]
          Fix Version/s 10.5.3.2 [ 12315436 ]
          Fix Version/s 10.6.2.3 [ 12315434 ]
          Fix Version/s 10.7.1.4 [ 12315902 ]
          Mike Matrigali made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Knut Anders Hatlen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Gavin made changes -
          Workflow jira [ 12498599 ] Default workflow, editable Closed status [ 12799103 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development