Skip to content

Commit a46ce28

Browse files
authored
Remove txn for wasm-bpt-printer (#756)
Remove txn for P2
1 parent c4f96a1 commit a46ce28

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tools/wasm-bpt-printer/wasm-bpt-printer.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ auto UsageMessage() -> std::string {
4141
using BPT = BPlusTree<GenericKey<8>, RID, GenericComparator<8>>;
4242
BPT *tree = nullptr;
4343
BufferPoolManager *bpm = nullptr;
44-
Transaction *transaction = nullptr;
4544
std::unique_ptr<bustub::Schema> key_schema = nullptr;
4645

4746
extern "C" {
@@ -60,11 +59,9 @@ auto BusTubInit(int leaf_max_size, int internal_max_size) -> int {
6059
auto *disk_manager = new DiskManager("test.bustub");
6160
bpm = new BufferPoolManager(100, disk_manager);
6261
// create header_page
63-
page_id_t page_id;
64-
bpm->NewPage(&page_id);
62+
auto page_id = bpm->NewPage();
6563
// create b+ tree
6664
tree = new BPT("foo_pk", page_id, bpm, comparator, leaf_max_size, internal_max_size);
67-
transaction = new Transaction(0);
6865
return 0;
6966
}
7067

@@ -87,7 +84,7 @@ auto BusTubApplyCommand(const char *input, char *output, uint16_t len) -> int {
8784
return 1;
8885
}
8986
index_key.SetFromInteger(key);
90-
tree->Remove(index_key, transaction);
87+
tree->Remove(index_key);
9188
break;
9289
case 'i':
9390
ss >> key;
@@ -96,7 +93,7 @@ auto BusTubApplyCommand(const char *input, char *output, uint16_t len) -> int {
9693
}
9794
rid.Set(static_cast<int32_t>(key >> 32), static_cast<int>(key & 0xFFFFFFFF));
9895
index_key.SetFromInteger(key);
99-
tree->Insert(index_key, rid, transaction);
96+
tree->Insert(index_key, rid);
10097
break;
10198
case '?':
10299
std::cout << UsageMessage();

0 commit comments

Comments
 (0)