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

more TDB

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