fix(tdb): typo casues large page crash
This commit is contained in:
parent
95dbfd4813
commit
16275caa8d
|
@ -371,7 +371,7 @@ static int tdbDefaultKeyCmprFn(const void *pKey1, int keyLen1, const void *pKey2
|
||||||
}
|
}
|
||||||
return cret;
|
return cret;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
static int tdbBtreeOpenImpl(SBTree *pBt) {
|
static int tdbBtreeOpenImpl(SBTree *pBt) {
|
||||||
// Try to get the root page of the an existing btree
|
// Try to get the root page of the an existing btree
|
||||||
SPgno pgno;
|
SPgno pgno;
|
||||||
|
@ -400,7 +400,7 @@ static int tdbBtreeOpenImpl(SBTree *pBt) {
|
||||||
pBt->root = pgno;
|
pBt->root = pgno;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
int tdbBtreeInitPage(SPage *pPage, void *arg, int init) {
|
int tdbBtreeInitPage(SPage *pPage, void *arg, int init) {
|
||||||
SBTree *pBt;
|
SBTree *pBt;
|
||||||
u8 flags;
|
u8 flags;
|
||||||
|
|
|
@ -586,7 +586,7 @@ static inline void setLPageNFree(SPage *pPage, int nFree) {
|
||||||
|
|
||||||
// cell offset
|
// cell offset
|
||||||
static inline int getLPageCellOffset(SPage *pPage, int idx) {
|
static inline int getLPageCellOffset(SPage *pPage, int idx) {
|
||||||
ASSERT(idx >= 0 && idx < getPageCellNum(pPage));
|
ASSERT(idx >= 0 && idx < getLPageCellNum(pPage));
|
||||||
return TDB_GET_U24(pPage->pCellIdx + 3 * idx);
|
return TDB_GET_U24(pPage->pCellIdx + 3 * idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ int tdbPagerClose(SPager *pPager) {
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
int tdbPagerOpenDB(SPager *pPager, SPgno *ppgno, bool toCreate, SBTree *pBt) {
|
int tdbPagerOpenDB(SPager *pPager, SPgno *ppgno, bool toCreate, SBTree *pBt) {
|
||||||
SPgno pgno;
|
SPgno pgno;
|
||||||
SPage *pPage;
|
SPage *pPage;
|
||||||
|
@ -167,7 +167,7 @@ int tdbPagerOpenDB(SPager *pPager, SPgno *ppgno, bool toCreate, SBTree *pBt) {
|
||||||
*ppgno = pgno;
|
*ppgno = pgno;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
int tdbPagerWrite(SPager *pPager, SPage *pPage) {
|
int tdbPagerWrite(SPager *pPager, SPage *pPage) {
|
||||||
int ret;
|
int ret;
|
||||||
SPage **ppPage;
|
SPage **ppPage;
|
||||||
|
|
Loading…
Reference in New Issue