more
This commit is contained in:
parent
b5e9f2aca0
commit
cee75c2ba3
|
@ -162,7 +162,7 @@ int tdbBtreeInsert(SBTree *pBt, const void *pKey, int kLen, const void *pVal, in
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure enough space to hold the space
|
// make sure enough space to hold the cell
|
||||||
szBuf = kLen + vLen + 14;
|
szBuf = kLen + vLen + 14;
|
||||||
pBuf = TDB_REALLOC(pBt->pBuf, pBt->pageSize > szBuf ? szBuf : pBt->pageSize);
|
pBuf = TDB_REALLOC(pBt->pBuf, pBt->pageSize > szBuf ? szBuf : pBt->pageSize);
|
||||||
if (pBuf == NULL) {
|
if (pBuf == NULL) {
|
||||||
|
@ -181,6 +181,14 @@ int tdbBtreeInsert(SBTree *pBt, const void *pKey, int kLen, const void *pVal, in
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mark the page dirty
|
||||||
|
ret = tdbPagerWrite(pBt->pPager, btc.pPage);
|
||||||
|
if (ret < 0) {
|
||||||
|
tdbBtcClose(&btc);
|
||||||
|
ASSERT(0);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// insert the cell
|
// insert the cell
|
||||||
ret = tdbPageInsertCell(btc.pPage, idx, pCell, szCell, 0);
|
ret = tdbPageInsertCell(btc.pPage, idx, pCell, szCell, 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
Loading…
Reference in New Issue