Helper function to update the parent pointer of a node. @param tid - the transaction id @param dirtypages - the list of dirty pages which should be updated with all new dirty pages @param pid - id of the parent node @param child - id of the child node to be updated with the parent pointer @throws D
(TransactionId tid, Map<PageId, Page> dirtypages, BTreePageId pid, BTreePageId child)
| 448 | * @throws TransactionAbortedException |
| 449 | */ |
| 450 | private void updateParentPointer(TransactionId tid, Map<PageId, Page> dirtypages, BTreePageId pid, BTreePageId child) |
| 451 | throws DbException, TransactionAbortedException { |
| 452 | |
| 453 | BTreePage p = (BTreePage) getPage(tid, dirtypages, child, Permissions.READ_ONLY); |
| 454 | |
| 455 | if(!p.getParentId().equals(pid)) { |
| 456 | p = (BTreePage) getPage(tid, dirtypages, child, Permissions.READ_WRITE); |
| 457 | p.setParentId(pid); |
| 458 | } |
| 459 | |
| 460 | } |
| 461 | |
| 462 | /** |
| 463 | * Update the parent pointer of every child of the given page so that it correctly points to |
no test coverage detected