Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

Commit 5adb39b

Browse files
committed
fix
1 parent 04d1033 commit 5adb39b

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

benchmark/bplus_tree_concurrency_test.cpp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ See the Mulan PSL v2 for more details. */
1919
#include "common/math/integer_generator.h"
2020
#include "storage/buffer/disk_buffer_pool.h"
2121
#include "storage/index/bplus_tree.h"
22+
#include "storage/index/index_meta.h"
23+
#include "storage/field/field_meta.h"
24+
#include "sql/parser/parse_defs.h"
2225
#include "storage/clog/vacuous_log_handler.h"
2326
#include "storage/buffer/double_write_buffer.h"
2427

@@ -65,13 +68,24 @@ class BenchmarkBase : public Fixture
6568

6669
::remove(btree_filename.c_str());
6770

68-
const int internal_max_size = 200;
69-
const int leaf_max_size = 200;
70-
7171
const char *filename = btree_filename.c_str();
7272

73-
RC rc = handler_.create(
74-
log_handler_, bpm_, filename, AttrType::INTS, sizeof(int32_t) /*attr_len*/, internal_max_size, leaf_max_size);
73+
// Create FieldMeta for the index
74+
FieldMeta field_meta;
75+
RC rc = field_meta.init("test_field", AttrType::INTS, 0, sizeof(int32_t), true, 0, true, true);
76+
if (rc != RC::SUCCESS) {
77+
throw runtime_error("failed to init field meta");
78+
}
79+
80+
// Create IndexMeta
81+
IndexMeta index_meta;
82+
vector<FieldMeta> fields = {field_meta};
83+
rc = index_meta.init("test_index", IndexType::BPlusTreeIndex, fields, false);
84+
if (rc != RC::SUCCESS) {
85+
throw runtime_error("failed to init index meta");
86+
}
87+
88+
rc = handler_.create(log_handler_, bpm_, filename, index_meta);
7589
if (rc != RC::SUCCESS) {
7690
throw runtime_error("failed to create btree handler");
7791
}

benchmark/pax_storage_concurrency_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class BenchmarkBase : public Fixture
117117
table_meta_->fields_[1].attr_len_ = 11;
118118
table_meta_->fields_[1].field_id_ = 1;
119119
handler_ = new RecordFileHandler(StorageFormat::PAX_FORMAT);
120-
rc = handler_->init(*buffer_pool_, log_handler_, table_meta_, nullptr);
120+
rc = handler_->init(*buffer_pool_, log_handler_, table_meta_);
121121
if (rc != RC::SUCCESS) {
122122
LOG_WARN("failed to init record file handler. rc=%s", strrc(rc));
123123
throw runtime_error("failed to init record file handler");

benchmark/record_manager_concurrency_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class BenchmarkBase : public Fixture
106106
}
107107

108108
handler_ = new RecordFileHandler(StorageFormat::ROW_FORMAT);
109-
rc = handler_->init(*buffer_pool_, log_handler_, nullptr, nullptr);
109+
rc = handler_->init(*buffer_pool_, log_handler_, nullptr);
110110
if (rc != RC::SUCCESS) {
111111
LOG_WARN("failed to init record file handler. rc=%s", strrc(rc));
112112
throw runtime_error("failed to init record file handler");

0 commit comments

Comments
 (0)