提交 ec3cb6fd 编写于 作者: H Hongze Cheng

more TDB

上级 07f6afe7
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册