提交 5cdfc49b 编写于 作者: H Hongze Cheng

more TDB

上级 ec3cb6fd
......@@ -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);
}
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册