提交 6eb2e1b2 编写于 作者: H Hongze Cheng

more TDB

上级 f91124ef
...@@ -136,19 +136,26 @@ int tdbPageDropCell(SPage *pPage, int idx) { ...@@ -136,19 +136,26 @@ int tdbPageDropCell(SPage *pPage, int idx) {
SCell *pCell; SCell *pCell;
int szCell; int szCell;
int nCells; int nCells;
int iOvfl;
nCells = TDB_PAGE_NCELLS(pPage); nCells = TDB_PAGE_NCELLS(pPage);
if (pPage->nOverflow == 0) { ASSERT(idx >= 0 && idx < nCells + pPage->nOverflow);
lidx = idx;
} else { iOvfl = 0;
// TODO for (; iOvfl < pPage->nOverflow; iOvfl++) {
if (pPage->aiOvfl[iOvfl] == idx) {
// TODO: remove the over flow cell
return 0;
} else if (pPage->aiOvfl[iOvfl] > idx) {
break;
}
} }
lidx = idx - iOvfl;
pCell = TDB_PAGE_CELL_AT(pPage, lidx); pCell = TDB_PAGE_CELL_AT(pPage, lidx);
szCell = (*pPage->xCellSize)(pCell); szCell = (*pPage->xCellSize)(pCell);
tdbPageFree(pPage, lidx, pCell, szCell); tdbPageFree(pPage, lidx, pCell, szCell);
TDB_PAGE_NCELLS_SET(pPage, nCells - 1); TDB_PAGE_NCELLS_SET(pPage, nCells - 1);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册