make test pass

This commit is contained in:
Hongze Cheng 2022-04-26 01:42:43 +00:00
parent 7b8f58d3b2
commit 9283f1cbbe
2 changed files with 36 additions and 38 deletions

View File

@ -171,52 +171,59 @@ SSchemaWrapper *metaGetTableSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver, boo
return pSW; 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 *metaOpenCtbCursor(SMeta *pMeta, tb_uid_t uid) {
SMCtbCursor *pCtbCur = NULL; SMCtbCursor *pCtbCur = NULL;
// SMetaDB *pDB = pMeta->pDB; int ret;
// int ret;
// pCtbCur = (SMCtbCursor *)taosMemoryCalloc(1, sizeof(*pCtbCur)); pCtbCur = (SMCtbCursor *)taosMemoryCalloc(1, sizeof(*pCtbCur));
// if (pCtbCur == NULL) { if (pCtbCur == NULL) {
// return NULL; return NULL;
// } }
// pCtbCur->suid = uid; pCtbCur->suid = uid;
// ret = tdbDbcOpen(pDB->pCtbIdx, &pCtbCur->pCur); ret = tdbDbcOpen(pMeta->pCtbIdx, &pCtbCur->pCur);
// if (ret < 0) { if (ret < 0) {
// taosMemoryFree(pCtbCur); taosMemoryFree(pCtbCur);
// return NULL; return NULL;
// } }
return pCtbCur; return pCtbCur;
} }
void metaCloseCtbCurosr(SMCtbCursor *pCtbCur) { void metaCloseCtbCurosr(SMCtbCursor *pCtbCur) {
// if (pCtbCur) { if (pCtbCur) {
// if (pCtbCur->pCur) { if (pCtbCur->pCur) {
// tdbDbcClose(pCtbCur->pCur); tdbDbcClose(pCtbCur->pCur);
// TDB_FREE(pCtbCur->pKey); TDB_FREE(pCtbCur->pKey);
// TDB_FREE(pCtbCur->pVal); TDB_FREE(pCtbCur->pVal);
// } }
// taosMemoryFree(pCtbCur); taosMemoryFree(pCtbCur);
// } }
} }
tb_uid_t metaCtbCursorNext(SMCtbCursor *pCtbCur) { tb_uid_t metaCtbCursorNext(SMCtbCursor *pCtbCur) {
// int ret; int ret;
// SCtbIdxKey *pCtbIdxKey; SCtbIdxKey *pCtbIdxKey;
// ret = tdbDbNext(pCtbCur->pCur, &pCtbCur->pKey, &pCtbCur->kLen, &pCtbCur->pVal, &pCtbCur->vLen); ret = tdbDbNext(pCtbCur->pCur, &pCtbCur->pKey, &pCtbCur->kLen, &pCtbCur->pVal, &pCtbCur->vLen);
// if (ret < 0) { if (ret < 0) {
// return 0; return 0;
// } }
// pCtbIdxKey = pCtbCur->pKey; pCtbIdxKey = pCtbCur->pKey;
// return pCtbIdxKey->uid; return pCtbIdxKey->uid;
return 0;
} }
STSchema *metaGetTbTSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver) { STSchema *metaGetTbTSchema(SMeta *pMeta, tb_uid_t uid, int32_t sver) {

View File

@ -406,15 +406,6 @@ static SSchemaWrapper *metaGetTableSchemaImpl(SMeta *pMeta, tb_uid_t uid, int32_
return pSchemaWrapper; return pSchemaWrapper;
} }
struct SMCtbCursor {
TDBC *pCur;
tb_uid_t suid;
void *pKey;
void *pVal;
int kLen;
int vLen;
};
struct SMSmaCursor { struct SMSmaCursor {
TDBC *pCur; TDBC *pCur;
tb_uid_t uid; tb_uid_t uid;