This commit is contained in:
Hongze Cheng 2022-03-16 03:07:40 +00:00
parent ec3cb6fd9c
commit 5cdfc49ba0
2 changed files with 9 additions and 7 deletions

View File

@ -233,10 +233,13 @@ static int tdbBtCursorMoveTo(SBtCursor *pCur, const void *pKey, int kLen, int *p
c = pBt->kcmpr(pKey, kLen, cd.pKey, cd.kLen);
if (c < 0) {
/* TODO */
ASSERT(0);
} else if (c > 0) {
/* TODO */
ASSERT(0);
} else {
/* TODO */
ASSERT(0);
}
}
}
@ -797,9 +800,7 @@ static int tdbBtreeDecodePayload(SPage *pPage, const u8 *pPayload, SCellDecoder
if (!pDecoder->pVal) {
pDecoder->pVal = (void *)(pPayload + pDecoder->kLen);
}
}
{
} else {
// TODO: handle overflow case
ASSERT(0);
}

View File

@ -62,19 +62,20 @@ static inline int tdbGetVarInt(const u8 *p, int *v) {
int tv = 0;
for (;;) {
if (p[n] & 0x80 == 0) {
tv = (tv << 7) & p[n];
if (p[n] <= 0x7f) {
tv = (tv << 7) | p[n];
n++;
break;
}
tv = (tv << 7) & (p[n] & 0x7f);
tv = (tv << 7) | (p[n] & 0x7f);
n++;
}
ASSERT(n < 6);
return 0;
*v = tv;
return n;
}
#ifdef __cplusplus