提交 5668624f 编写于 作者: H Hongze Cheng

more TDB

上级 e7230ab3
......@@ -526,10 +526,42 @@ static int tdbBtreeBalanceStep1(SBtreeBalanceHelper *pBlh) {
static int tdbBtreeBalanceStep2(SBtreeBalanceHelper *pBlh) {
SPage *pPage;
int oidx;
int cidx;
int limit;
SCell *pCell;
for (int i = 0; i < pBlh->nOldPages; i++) {
pPage = pBlh->pOldPages[i];
/* code */
oidx = 0;
cidx = 0;
if (oidx < pPage->nOverflow) {
limit = pPage->aiOvfl[oidx];
} else {
limit = pPage->pPageHdr->nCells;
}
// Loop to copy each cell pointer out
for (;;) {
if (oidx >= pPage->nOverflow && cidx >= pPage->pPageHdr->nCells) break;
if (cidx < limit) {
// Get local cells
pCell = TDB_PAGE_CELL_AT(pPage, cidx);
} else if (cidx == limit) {
// Get overflow cells
pCell = pPage->apOvfl[oidx++];
if (oidx < pPage->nOverflow) {
limit = pPage->aiOvfl[oidx];
} else {
limit = pPage->pPageHdr->nCells;
}
} else {
ASSERT(0);
}
}
}
/* TODO */
......
......@@ -49,7 +49,7 @@ struct SPage {
int maxLocal;
int minLocal;
int nOverflow;
void *apOvfl[4];
SCell *apOvfl[4];
int aiOvfl[4];
// Fields used by SPCache
TDB_PCACHE_PAGE
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册