db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4083) BTreeScan.delete() throws AM_RECORD_NOT_FOUND if record is found
Date Thu, 03 Jun 2010 12:15:58 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4083?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Knut Anders Hatlen updated DERBY-4083:

    Attachment: test.diff

Attached is a patch that adds a test case to the T_b2i test and some debug code to release
the latch in BTreeScan. When running the test with sane jars, it fails with the following

ERROR XSAM6: Record {2} on page 7 in container 625 not found.

> BTreeScan.delete() throws AM_RECORD_NOT_FOUND if record is found
> ----------------------------------------------------------------
>                 Key: DERBY-4083
>                 URL: https://issues.apache.org/jira/browse/DERBY-4083
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions:
>            Reporter: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: test.diff
> 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()));
>                     }
>                 }
>             }

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message