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) {
|
||||
// General case without overflow
|
||||
pDecoder->pKey = (void *)pPayload;
|
||||
if (pDecoder->pVal) {
|
||||
pDecoder->pVal = (void *)(pPayload + pDecoder->vLen);
|
||||
if (!pDecoder->pVal) {
|
||||
pDecoder->pVal = (void *)(pPayload + pDecoder->kLen);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ int tdbPageInsertCell(SPage *pPage, int idx, SCell *pCell, int 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);
|
||||
TDB_PAGE_CELL_OFFSET_AT_SET(pPage, idx, pTarget - pPage->pData);
|
||||
TDB_PAGE_NCELLS_SET(pPage, TDB_PAGE_NCELLS(pPage) + 1);
|
||||
|
|
Loading…
Reference in New Issue