提交 c1de4df9 编写于 作者: M Minglei Jin

fix: fix page capacity calculation

上级 61e3250e
......@@ -246,14 +246,17 @@ void tdbPageCopy(SPage *pFromPage, SPage *pToPage) {
int tdbPageCapacity(int pageSize, int amHdrSize) {
int szPageHdr;
int minCellIndexSize; // at least one cell in cell index
if (pageSize < 65536) {
szPageHdr = pageMethods.szPageHdr;
minCellIndexSize = pageMethods.szOffset;
} else {
szPageHdr = pageLargeMethods.szPageHdr;
minCellIndexSize = pageLargeMethods.szOffset;
}
return pageSize - szPageHdr - amHdrSize;
return pageSize - szPageHdr - amHdrSize - sizeof(SPageFtr) - minCellIndexSize;
}
static int tdbPageAllocate(SPage *pPage, int szCell, SCell **ppCell) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册