Skip to content

Commit

Permalink
fix: fix page guard sample test (#695)
Browse files Browse the repository at this point in the history
* fix page guard sample test

* add upgraderead & upgradewrite method
  • Loading branch information
xx01cyx committed Jan 30, 2024
1 parent b6cc751 commit bd62db0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/storage/page/page_guard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ auto BasicPageGuard::operator=(BasicPageGuard &&that) noexcept -> BasicPageGuard

BasicPageGuard::~BasicPageGuard(){}; // NOLINT

auto BasicPageGuard::UpgradeRead() -> ReadPageGuard { return {bpm_, page_}; }

auto BasicPageGuard::UpgradeWrite() -> WritePageGuard { return {bpm_, page_}; }

ReadPageGuard::ReadPageGuard(BufferPoolManager *bpm, Page *page) {}

ReadPageGuard::ReadPageGuard(ReadPageGuard &&that) noexcept = default;
Expand Down
1 change: 0 additions & 1 deletion test/storage/page_guard_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ TEST(PageGuardTest, DISABLED_SampleTest) {

{
auto *page2 = bpm->NewPage(&page_id_temp);
page2->RLatch();
auto guard2 = ReadPageGuard(bpm.get(), page2);
}

Expand Down

0 comments on commit bd62db0

Please sign in to comment.