more TDB
This commit is contained in:
parent
07f6afe73e
commit
ec3cb6fd9c
|
@ -794,8 +794,8 @@ static int tdbBtreeDecodePayload(SPage *pPage, const u8 *pPayload, SCellDecoder
|
||||||
if (nPayload <= pPage->maxLocal) {
|
if (nPayload <= pPage->maxLocal) {
|
||||||
// General case without overflow
|
// General case without overflow
|
||||||
pDecoder->pKey = (void *)pPayload;
|
pDecoder->pKey = (void *)pPayload;
|
||||||
if (pDecoder->pVal) {
|
if (!pDecoder->pVal) {
|
||||||
pDecoder->pVal = (void *)(pPayload + pDecoder->vLen);
|
pDecoder->pVal = (void *)(pPayload + pDecoder->kLen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ int tdbPageInsertCell(SPage *pPage, int idx, SCell *pCell, int szCell) {
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(pTarget, pCell, szCell);
|
memcpy(pTarget, pCell, szCell);
|
||||||
pTmp = pPage->pCellIdx + idx + pPage->szOffset;
|
pTmp = pPage->pCellIdx + idx * pPage->szOffset;
|
||||||
memmove(pTmp, pTmp + pPage->szOffset, pPage->pFreeStart - pTmp - pPage->szOffset);
|
memmove(pTmp, pTmp + pPage->szOffset, pPage->pFreeStart - pTmp - pPage->szOffset);
|
||||||
TDB_PAGE_CELL_OFFSET_AT_SET(pPage, idx, pTarget - pPage->pData);
|
TDB_PAGE_CELL_OFFSET_AT_SET(pPage, idx, pTarget - pPage->pData);
|
||||||
TDB_PAGE_NCELLS_SET(pPage, TDB_PAGE_NCELLS(pPage) + 1);
|
TDB_PAGE_NCELLS_SET(pPage, TDB_PAGE_NCELLS(pPage) + 1);
|
||||||
|
|
Loading…
Reference in New Issue