提交 5ca3e29c 编写于 作者: H Hongze Cheng

more TDB

上级 2e6f7f15
......@@ -467,6 +467,7 @@ static int tdbBtreeBalanceDeeper(SBTree *pBt, SPage *pRoot, SPage **ppChild) {
SPage *pChild;
SPgno pgnoChild;
int ret;
SIntHdr *pIntHdr;
SBtreeInitPageArg zArg;
pPager = pRoot->pPager;
......@@ -490,7 +491,8 @@ static int tdbBtreeBalanceDeeper(SBTree *pBt, SPage *pRoot, SPage **ppChild) {
return -1;
}
// TODO: ((SBtPageHdr *)pRoot->pAmHdr)[0].rChild = pgnoChild;
pIntHdr = (SIntHdr *)(pRoot->pAmHdr);
pIntHdr->pgno = pgnoChild;
*ppChild = pChild;
return 0;
......@@ -731,7 +733,7 @@ static int tdbBtreeBalance(SBtCursor *pCur) {
// ignore the case of empty
if (pPage->nOverflow == 0) break;
ret = tdbBtreeBalanceDeeper(pCur->pBt, pCur->pPage, &(pCur->pgStack[1]));
ret = tdbBtreeBalanceDeeper(pCur->pBt, pPage, &(pCur->pgStack[1]));
if (ret < 0) {
return -1;
}
......
......@@ -416,7 +416,6 @@ static int tdbPageDefragment(SPage *pPage) {
/* ---------------------------------------------------------------------------------------------------------- */
typedef struct __attribute__((__packed__)) {
u16 flags;
u16 cellNum;
u16 cellBody;
u16 cellFree;
......
......@@ -16,11 +16,10 @@
#include "tdbInt.h"
typedef struct __attribute__((__packed__)) {
u16 flags;
u8 cellNum[3];
u8 cellBody[3];
u8 cellFree[3];
u8 nFree[3];
u8 cellNum[3];
u8 cellBody[3];
u8 cellFree[3];
u8 nFree[3];
} SPageHdrL;
typedef struct __attribute__((__packed__)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册