提交 7d5030bc 编写于 作者: H Hongze Cheng

more TDB

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