Derby
  1. Derby
  2. DERBY-4083

BTreeScan.delete() throws AM_RECORD_NOT_FOUND if record is found

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.4.2.0
    • Fix Version/s: 10.7.1.1
    • Component/s: Store
    • Labels:
      None
    • Urgency:
      Normal
    • Issue & fix info:
      Repro attached

      Description

      The code below is from BTreeScan.delete(). If the call to reposition() manages to position on the row, an exception is raised indicating that the row could not be found. If the row is not found, no exception is raised, but code later in the method will probably throw a NullPointerException because scan_position.current_leaf is set to null by reposition(). I believe that "if (reposition(...))" should be changed to "if (!reposition(...))". According to the test coverage reports, this code is not exercised by any of the existing tests.

      if (latch_released)
      {
      // lost latch on page in order to wait for row lock.
      // Because we have scan lock on page, we need only
      // call reposition() which will use the saved record
      // handle to reposition to the same spot on the page.
      // We don't have to search the
      // tree again, as we have the a scan lock on the page
      // which means the current_rh is valid to reposition on.
      if (reposition(scan_position, false))

      { throw StandardException.newException( SQLState.AM_RECORD_NOT_FOUND, new Long(err_containerid), new Long(scan_position.current_rh.getId())); }

      }
      }

      1. derby-4083-1a.diff
        8 kB
        Knut Anders Hatlen
      2. test.diff
        7 kB
        Knut Anders Hatlen

        Activity

        Gavin made changes -
        Workflow jira [ 12454114 ] Default workflow, editable Closed status [ 12800256 ]
        Rick Hillegas made changes -
        Fix Version/s 10.7.1.1 [ 12315564 ]
        Fix Version/s 10.7.1.0 [ 12314971 ]
        Knut Anders Hatlen made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Issue & fix info [Patch Available, Repro attached] [Repro attached]
        Fix Version/s 10.7.0.0 [ 12314971 ]
        Resolution Fixed [ 1 ]
        Knut Anders Hatlen made changes -
        Issue & fix info [Repro attached] [Patch Available, Repro attached]
        Knut Anders Hatlen made changes -
        Attachment derby-4083-1a.diff [ 12446348 ]
        Knut Anders Hatlen made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Knut Anders Hatlen made changes -
        Assignee Knut Anders Hatlen [ knutanders ]
        Issue & fix info [Repro attached]
        Knut Anders Hatlen made changes -
        Attachment test.diff [ 12446243 ]
        Rick Hillegas made changes -
        Field Original Value New Value
        Urgency Normal
        Knut Anders Hatlen created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development