This commit is contained in:
Hongze Cheng 2022-03-31 07:52:35 +00:00
parent ba4b33e7c7
commit 71c8b91059
1 changed files with 13 additions and 1 deletions

View File

@ -312,7 +312,8 @@ static int tdbBtreeOpenImpl(SBTree *pBt) {
return -1;
}
// TODO: Unref the page
// TODO: here still has problem
tdbPagerReturnPage(pBt->pPager, pPage);
ASSERT(pgno != 0);
pBt->root = pgno;
@ -763,6 +764,15 @@ static int tdbBtreeBalanceNonRoot(SBTree *pBt, SPage *pParent, int idx) {
}
}
// TODO: here is not corrent for drop case
for (int i = 0; i < nNews; i++) {
if (i < nOlds) {
tdbPagerReturnPage(pBt->pPager, pOlds[i]);
} else {
tdbPagerReturnPage(pBt->pPager, pNews[i]);
}
}
return 0;
}
@ -814,6 +824,8 @@ static int tdbBtreeBalance(SBTC *pBtc) {
return -1;
}
tdbPagerReturnPage(pBtc->pBt->pPager, pBtc->pPage);
pBtc->iPage--;
pBtc->pPage = pBtc->pgStack[pBtc->iPage];
}