提交 46aed970 编写于 作者: H Hongze Cheng

more TDB

上级 83030349
......@@ -138,7 +138,7 @@ int tdbPageInsertCell(SPage *pPage, int idx, SCell *pCell, int szCell) {
memcpy(pTarget, pCell, szCell);
pTmp = pPage->pCellIdx + idx * pPage->szOffset;
memmove(pTmp, pTmp + pPage->szOffset, pPage->pFreeStart - pTmp - pPage->szOffset);
memmove(pTmp + pPage->szOffset, pTmp, 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);
}
......
......@@ -22,8 +22,8 @@ TEST(tdb_test, simple_test) {
ret = tdbDbInsert(pDb, "key2", 4, "value1", 6);
GTEST_ASSERT_EQ(ret, 0);
ret = tdbDbInsert(pDb, "key3", 4, "value1", 6);
GTEST_ASSERT_EQ(ret, 0);
// ret = tdbDbInsert(pDb, "key3", 4, "value1", 6);
// GTEST_ASSERT_EQ(ret, 0);
}
ret = tdbDbDrop(pDb);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册