提交 3f4551fa 编写于 作者: H Hongze Cheng

fix ctb cursor issue

上级 6d9ae1af
...@@ -374,22 +374,27 @@ static int metaCtbIdxCb(DB *pIdx, const DBT *pKey, const DBT *pValue, DBT *pSKey ...@@ -374,22 +374,27 @@ static int metaCtbIdxCb(DB *pIdx, const DBT *pKey, const DBT *pValue, DBT *pSKey
DBT * pDbt; DBT * pDbt;
if (pTbCfg->type == META_CHILD_TABLE) { if (pTbCfg->type == META_CHILD_TABLE) {
pDbt = calloc(2, sizeof(DBT)); // pDbt = calloc(2, sizeof(DBT));
// First key is suid // // First key is suid
pDbt[0].data = &(pTbCfg->ctbCfg.suid); // pDbt[0].data = &(pTbCfg->ctbCfg.suid);
pDbt[0].size = sizeof(pTbCfg->ctbCfg.suid); // pDbt[0].size = sizeof(pTbCfg->ctbCfg.suid);
// Second key is the first tag // // Second key is the first tag
void *pTagVal = tdGetKVRowValOfCol(pTbCfg->ctbCfg.pTag, (kvRowColIdx(pTbCfg->ctbCfg.pTag))[0].colId); // void *pTagVal = tdGetKVRowValOfCol(pTbCfg->ctbCfg.pTag, (kvRowColIdx(pTbCfg->ctbCfg.pTag))[0].colId);
pDbt[1].data = pTagVal; // pDbt[1].data = pTagVal;
pDbt[1].size = sizeof(int32_t); // pDbt[1].size = sizeof(int32_t);
// Set index key // Set index key
memset(pSKey, 0, sizeof(*pSKey)); memset(pSKey, 0, sizeof(*pSKey));
#if 0
pSKey->flags = DB_DBT_MULTIPLE | DB_DBT_APPMALLOC; pSKey->flags = DB_DBT_MULTIPLE | DB_DBT_APPMALLOC;
pSKey->data = pDbt; pSKey->data = pDbt;
pSKey->size = 2; pSKey->size = 2;
#else
pSKey->data = &(pTbCfg->ctbCfg.suid);
pSKey->size = sizeof(pTbCfg->ctbCfg.suid);
#endif
return 0; return 0;
} else { } else {
...@@ -673,8 +678,8 @@ tb_uid_t metaCtbCursorNext(SMCtbCursor *pCtbCur) { ...@@ -673,8 +678,8 @@ tb_uid_t metaCtbCursorNext(SMCtbCursor *pCtbCur) {
tb_uid_t id = *(tb_uid_t *)pkey.data; tb_uid_t id = *(tb_uid_t *)pkey.data;
assert(id != 0); assert(id != 0);
return id; return id;
// metaDecodeTbInfo(pBuf, &tbCfg); // metaDecodeTbInfo(pBuf, &tbCfg);
// return tbCfg.; // return tbCfg.;
} else { } else {
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册