提交 9283f1cb 编写于 作者: H Hongze Cheng

make test pass

上级 7b8f58d3
......@@ -171,52 +171,59 @@ SSchemaWrapper *metaGetTableSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver, boo
return pSW;
}
struct SMCtbCursor {
TDBC *pCur;
tb_uid_t suid;
void *pKey;
void *pVal;
int kLen;
int vLen;
};
SMCtbCursor *metaOpenCtbCursor(SMeta *pMeta, tb_uid_t uid) {
SMCtbCursor *pCtbCur = NULL;
// SMetaDB *pDB = pMeta->pDB;
// int ret;
int ret;
// pCtbCur = (SMCtbCursor *)taosMemoryCalloc(1, sizeof(*pCtbCur));
// if (pCtbCur == NULL) {
// return NULL;
// }
pCtbCur = (SMCtbCursor *)taosMemoryCalloc(1, sizeof(*pCtbCur));
if (pCtbCur == NULL) {
return NULL;
}
// pCtbCur->suid = uid;
// ret = tdbDbcOpen(pDB->pCtbIdx, &pCtbCur->pCur);
// if (ret < 0) {
// taosMemoryFree(pCtbCur);
// return NULL;
// }
pCtbCur->suid = uid;
ret = tdbDbcOpen(pMeta->pCtbIdx, &pCtbCur->pCur);
if (ret < 0) {
taosMemoryFree(pCtbCur);
return NULL;
}
return pCtbCur;
}
void metaCloseCtbCurosr(SMCtbCursor *pCtbCur) {
// if (pCtbCur) {
// if (pCtbCur->pCur) {
// tdbDbcClose(pCtbCur->pCur);
if (pCtbCur) {
if (pCtbCur->pCur) {
tdbDbcClose(pCtbCur->pCur);
// TDB_FREE(pCtbCur->pKey);
// TDB_FREE(pCtbCur->pVal);
// }
TDB_FREE(pCtbCur->pKey);
TDB_FREE(pCtbCur->pVal);
}
// taosMemoryFree(pCtbCur);
// }
taosMemoryFree(pCtbCur);
}
}
tb_uid_t metaCtbCursorNext(SMCtbCursor *pCtbCur) {
// int ret;
// SCtbIdxKey *pCtbIdxKey;
int ret;
SCtbIdxKey *pCtbIdxKey;
// ret = tdbDbNext(pCtbCur->pCur, &pCtbCur->pKey, &pCtbCur->kLen, &pCtbCur->pVal, &pCtbCur->vLen);
// if (ret < 0) {
// return 0;
// }
ret = tdbDbNext(pCtbCur->pCur, &pCtbCur->pKey, &pCtbCur->kLen, &pCtbCur->pVal, &pCtbCur->vLen);
if (ret < 0) {
return 0;
}
// pCtbIdxKey = pCtbCur->pKey;
pCtbIdxKey = pCtbCur->pKey;
// return pCtbIdxKey->uid;
return 0;
return pCtbIdxKey->uid;
}
STSchema *metaGetTbTSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver) {
......
......@@ -406,15 +406,6 @@ static SSchemaWrapper *metaGetTableSchemaImpl(SMeta *pMeta, tb_uid_t uid, int32_
return pSchemaWrapper;
}
struct SMCtbCursor {
TDBC *pCur;
tb_uid_t suid;
void *pKey;
void *pVal;
int kLen;
int vLen;
};
struct SMSmaCursor {
TDBC *pCur;
tb_uid_t uid;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册