Open xiaodp opened 2 months ago
observer和obclient编译都成功了,执行SQL错误是因为你的SQL确实有问题,比如当前不支持show databases命令。 编译出问题的这个是一个单测。我本地也是apple m1+clang 14,但是无法重现你的问题。
看报错信息是由于lambda中某些变量没有捕获导致的,可以把 ranges::for_each 改成 for 写法,或者把lambda的参数捕获改成 &,比如
ranges::for_each(buffer_pools, [](DiskBufferPool *buffer_pool) {
Frame *frame = nullptr;
ASSERT_EQ(RC::SUCCESS, buffer_pool->allocate_page(&frame));
ASSERT_EQ(RC::SUCCESS, buffer_pool->unpin_page(frame));
});
改成:
ranges::for_each(buffer_pools, [&](DiskBufferPool *buffer_pool) { // [] 变成了 [&]
Frame *frame = nullptr;
ASSERT_EQ(RC::SUCCESS, buffer_pool->allocate_page(&frame));
ASSERT_EQ(RC::SUCCESS, buffer_pool->unpin_page(frame));
});
再另外的一台m1 电脑上编译,也没有此问题,忽略掉好了。感谢回复~
Question
环境信息( 工具版本均符合文档要求):
编译步骤:
git clone https://github.com/oceanbase/miniob.git
cd miniob
sudo bash build.sh init
--这一步okbash build.sh
--这一步报错./observer
Welcome to the OceanBase database implementation course.
Copyright (c) 2021 OceanBase and/or its affiliates.
Learn more about OceanBase at https://github.com/oceanbase/oceanbase Learn more about MiniOB at https://github.com/oceanbase/miniob
Successfully load ../etc/observer.ini Not set log file name, use default observer.log Output configuration Begin dump configuration []
Finish dump configuration
Db already exists: sys Extend one pool, this->size:128, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:256, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:384, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:512, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:640, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:768, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:896, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:1024, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:1152, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:1280, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:1408, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:1536, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:1664, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:1792, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:1920, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:2048, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:2176, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:2304, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:2432, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:2560, item_num_per_pool:128, this->name:BufPool. Extend one pool, this->size:2560, item_num_per_pool:128, this->name:BufPool. buffer pool manager init with memory size 20971520, page num: 2560, pool num: 20 double write buffer load pages done. page num=0 Successfully read db meta file. db=sys, file=miniob/db/sys/sys.db, check_point_lsn=0 All table have been opened. num=0 Successfully recover db. db=sys checkpoint_lsn=0 Default handler init with miniob success Successfully init utility Listen on port 6789 Observer start success
➜ bin git:(main) ✗ ./obclient
Welcome to the OceanBase database implementation course.
Copyright (c) 2021 OceanBase and/or its affiliates.
Learn more about OceanBase at https://github.com/oceanbase/oceanbase Learn more about MiniOB at https://github.com/oceanbase/miniob
miniob > show databases; SQL_SYNTAX > Failed to parse sql miniob > show tables; Tables_in_SYS miniob > select * from Tables_in_SYS FAILURE miniob >
fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. make[2]: [unittest/CMakeFiles/buffer_pool_log_test.dir/buffer_pool_log_test.cpp.o] Error 1 make[1]: [unittest/CMakeFiles/buffer_pool_log_test.dir/all] Error 2 make: *** [all] Error 2