diff --git a/bpt/include/bpt/bpt.hpp b/bpt/include/bpt/bpt.hpp index 969880f..b4d35e4 100644 --- a/bpt/include/bpt/bpt.hpp +++ b/bpt/include/bpt/bpt.hpp @@ -512,6 +512,11 @@ class BPlusTreeIndexer { prev_page_guard.template As() ->data.p_data[prev_page_guard.template As()->data.key_count - 1] .first; + if (need_update) { + // now we need to check if we have to update the right bound till the root + pos.path.pop_back(); + TryUpdateTillRoot(pos); + } return; } } @@ -546,6 +551,9 @@ class BPlusTreeIndexer { .second; } } + // now we need to check if we have to update the right bound till the root + pos.path.pop_back(); + TryUpdateTillRoot(pos); return; } } diff --git a/test/oj_test_interface_for_bpt.cpp b/test/oj_test_interface_for_bpt.cpp index a1e6442..8e1b597 100644 --- a/test/oj_test_interface_for_bpt.cpp +++ b/test/oj_test_interface_for_bpt.cpp @@ -40,13 +40,17 @@ int main() { { BPlusTreeIndexer> bpt(buffer_pool_manager); int n; + // freopen("/workspaces/BH-TicketSystem/build/pro.in", "r", stdin); + // freopen("/workspaces/BH-TicketSystem/build/pro.out", "w", stdout); std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); std::string op, index; int val; std::cin >> n; + int opt_cnt = 0; while (n-- > 0) { + ++opt_cnt; std::cin >> op; if (op[0] == 'i') { std::cin >> index >> val; @@ -73,6 +77,9 @@ int main() { std::cout << '\n'; } else throw std::runtime_error("Invalid operation"); + // if (opt_cnt >= 133768) { + // bpt.CheckIndex(); + // } } } delete buffer_pool_manager; diff --git a/test/t1_mk.cpp b/test/t1_mk.cpp index 9775e3d..cb01973 100644 --- a/test/t1_mk.cpp +++ b/test/t1_mk.cpp @@ -21,8 +21,8 @@ int main(int argc, char *argv[]) { fprintf(fout, "Seed = %u\n", RndSeed); fclose(fout); // ====================================== - int n = 100000; - int total_keys = 30000; + int n = 300000; + int total_keys = 100000; set keys_set; for (int i = 0; i < total_keys; i++) { string key = "#" + to_string(rnd_less(1000000)) + "#";