提交 c479c85a 编写于 作者: H Hongze Cheng

fix page lock problem

上级 139b9b73
......@@ -284,7 +284,7 @@ static int tdbBtreeOpenImpl(SBTree *pBt) {
int ret;
{
// TODO: Search the main DB to check if the DB exists
// 1. TODO: Search the main DB to check if the DB exists
pgno = 0;
}
......@@ -294,13 +294,16 @@ static int tdbBtreeOpenImpl(SBTree *pBt) {
}
// Try to create a new database
// ret = tdbPagerNewPage(pBt->pPager, &pgno, &pPage);
// if (ret < 0) {
// return -1;
// }
SBtreeZeroPageArg zArg = {.flags = TDB_BTREE_ROOT | TDB_BTREE_LEAF, .pBt = pBt};
ret = tdbPagerNewPage(pBt->pPager, &pgno, &pPage, tdbBtreeZeroPage, &zArg);
if (ret < 0) {
return -1;
}
// TODO: Unref the page
// ASSERT(pgno != 0);
// pBt->root = pgno;
ASSERT(pgno != 0);
pBt->root = pgno;
return 0;
}
......
......@@ -235,6 +235,7 @@ static int tdbPCacheOpenImpl(SPCache *pCache) {
}
pPage = (SPage *)(&(pPtr[pCache->pageSize]));
TDB_INIT_PAGE_LOCK(pPage);
pPage->pData = (void *)pPtr;
// pPage->pgid = 0;
pPage->isAnchor = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册