提交 493670d2 编写于 作者: H Hongze Cheng

more TDB

上级 b6d27d37
...@@ -482,9 +482,11 @@ static int tdbBtreeBalanceDeeper(SBTree *pBt, SPage *pRoot, SPage **ppChild) { ...@@ -482,9 +482,11 @@ static int tdbBtreeBalanceDeeper(SBTree *pBt, SPage *pRoot, SPage **ppChild) {
u8 flags; u8 flags;
SIntHdr *pIntHdr; SIntHdr *pIntHdr;
SBtreeInitPageArg zArg; SBtreeInitPageArg zArg;
u8 leaf;
pPager = pRoot->pPager; pPager = pRoot->pPager;
flags = TDB_BTREE_PAGE_GET_FLAGS(pRoot); flags = TDB_BTREE_PAGE_GET_FLAGS(pRoot);
leaf = TDB_BTREE_PAGE_IS_LEAF(flags);
// Allocate a new child page // Allocate a new child page
zArg.flags = TDB_FLAG_REMOVE(flags, TDB_BTREE_ROOT); zArg.flags = TDB_FLAG_REMOVE(flags, TDB_BTREE_ROOT);
...@@ -494,6 +496,10 @@ static int tdbBtreeBalanceDeeper(SBTree *pBt, SPage *pRoot, SPage **ppChild) { ...@@ -494,6 +496,10 @@ static int tdbBtreeBalanceDeeper(SBTree *pBt, SPage *pRoot, SPage **ppChild) {
return -1; return -1;
} }
if (!leaf) {
((SIntHdr *)pChild->pData)->pgno = ((SIntHdr *)(pRoot->pData))->pgno;
}
// Copy the root page content to the child page // Copy the root page content to the child page
tdbPageCopy(pRoot, pChild); tdbPageCopy(pRoot, pChild);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册