This commit is contained in:
Hongze Cheng 2022-03-21 08:17:58 +00:00
parent 2e6f7f15d5
commit 5ca3e29cf1
3 changed files with 8 additions and 8 deletions

View File

@ -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) {
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) {
// 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;
} }

View File

@ -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;

View File

@ -16,7 +16,6 @@
#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];