This commit is contained in:
Hongze Cheng 2022-03-21 07:59:37 +00:00
parent b8954ae1c5
commit 2e6f7f15d5
2 changed files with 6 additions and 7 deletions

View File

@ -482,12 +482,6 @@ static int tdbBtreeBalanceDeeper(SBTree *pBt, SPage *pRoot, SPage **ppChild) {
// Copy the root page content to the child page
tdbPageCopy(pRoot, pChild);
pChild->nOverflow = pRoot->nOverflow;
for (int i = 0; i < pChild->nOverflow; i++) {
pChild->apOvfl[i] = pRoot->apOvfl[i];
pChild->aiOvfl[i] = pRoot->aiOvfl[i];
}
// Reinitialize the root page
zArg.flags = TDB_BTREE_ROOT;
zArg.pBt = pBt;

View File

@ -226,7 +226,12 @@ void tdbPageCopy(SPage *pFromPage, SPage *pToPage) {
TDB_PAGE_NFREE_SET(pToPage, nFree - delta);
}
// TODO: do we need to copy the overflow part ???
// Copy the overflow cells
for (int iOvfl = 0; iOvfl < pFromPage->nOverflow; iOvfl++) {
pToPage->aiOvfl[iOvfl] = pFromPage->aiOvfl[iOvfl];
pToPage->apOvfl[iOvfl] = pFromPage->apOvfl[iOvfl];
}
pToPage->nOverflow = pFromPage->nOverflow;
}
static int tdbPageAllocate(SPage *pPage, int szCell, SCell **ppCell) {