fix: copy rpgno with non-leaf pages
This commit is contained in:
parent
d0df914d8d
commit
5dddf1812b
|
@ -841,6 +841,10 @@ static int tdbBtreeBalanceNonRoot(SBTree *pBt, SPage *pParent, int idx, TXN *pTx
|
||||||
// copy content to the parent page
|
// copy content to the parent page
|
||||||
tdbBtreeInitPage(pParent, &(SBtreeInitPageArg){.flags = flags, .pBt = pBt}, 0);
|
tdbBtreeInitPage(pParent, &(SBtreeInitPageArg){.flags = flags, .pBt = pBt}, 0);
|
||||||
tdbPageCopy(pNews[0], pParent, 1);
|
tdbPageCopy(pNews[0], pParent, 1);
|
||||||
|
|
||||||
|
if (!TDB_BTREE_PAGE_IS_LEAF(pNews[0])) {
|
||||||
|
((SIntHdr *)(pParent->pData))->pgno = ((SIntHdr *)(pNews[0]->pData))->pgno;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
|
|
|
@ -260,7 +260,7 @@ int tdbPagerCommit(SPager *pPager, TXN *pTxn) {
|
||||||
|
|
||||||
pPage->isDirty = 0;
|
pPage->isDirty = 0;
|
||||||
|
|
||||||
// tRBTreeDrop(&pPager->rbt, (SRBTreeNode *)pPage);
|
tRBTreeDrop(&pPager->rbt, (SRBTreeNode *)pPage);
|
||||||
tdbPCacheRelease(pPager->pCache, pPage, pTxn);
|
tdbPCacheRelease(pPager->pCache, pPage, pTxn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,7 +353,7 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) {
|
||||||
|
|
||||||
pPage->isDirty = 0;
|
pPage->isDirty = 0;
|
||||||
|
|
||||||
// tRBTreeDrop(&pPager->rbt, (SRBTreeNode *)pPage);
|
tRBTreeDrop(&pPager->rbt, (SRBTreeNode *)pPage);
|
||||||
tdbPCacheRelease(pPager->pCache, pPage, pTxn);
|
tdbPCacheRelease(pPager->pCache, pPage, pTxn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue