more TDB
This commit is contained in:
parent
f91124ef8e
commit
6eb2e1b288
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue