fix ctb cursor issue
This commit is contained in:
parent
6d9ae1af99
commit
3f4551fa01
|
@ -374,22 +374,27 @@ static int metaCtbIdxCb(DB *pIdx, const DBT *pKey, const DBT *pValue, DBT *pSKey
|
|||
DBT * pDbt;
|
||||
|
||||
if (pTbCfg->type == META_CHILD_TABLE) {
|
||||
pDbt = calloc(2, sizeof(DBT));
|
||||
// pDbt = calloc(2, sizeof(DBT));
|
||||
|
||||
// First key is suid
|
||||
pDbt[0].data = &(pTbCfg->ctbCfg.suid);
|
||||
pDbt[0].size = sizeof(pTbCfg->ctbCfg.suid);
|
||||
// // First key is suid
|
||||
// pDbt[0].data = &(pTbCfg->ctbCfg.suid);
|
||||
// pDbt[0].size = sizeof(pTbCfg->ctbCfg.suid);
|
||||
|
||||
// Second key is the first tag
|
||||
void *pTagVal = tdGetKVRowValOfCol(pTbCfg->ctbCfg.pTag, (kvRowColIdx(pTbCfg->ctbCfg.pTag))[0].colId);
|
||||
pDbt[1].data = pTagVal;
|
||||
pDbt[1].size = sizeof(int32_t);
|
||||
// // Second key is the first tag
|
||||
// void *pTagVal = tdGetKVRowValOfCol(pTbCfg->ctbCfg.pTag, (kvRowColIdx(pTbCfg->ctbCfg.pTag))[0].colId);
|
||||
// pDbt[1].data = pTagVal;
|
||||
// pDbt[1].size = sizeof(int32_t);
|
||||
|
||||
// Set index key
|
||||
memset(pSKey, 0, sizeof(*pSKey));
|
||||
#if 0
|
||||
pSKey->flags = DB_DBT_MULTIPLE | DB_DBT_APPMALLOC;
|
||||
pSKey->data = pDbt;
|
||||
pSKey->size = 2;
|
||||
#else
|
||||
pSKey->data = &(pTbCfg->ctbCfg.suid);
|
||||
pSKey->size = sizeof(pTbCfg->ctbCfg.suid);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
} else {
|
||||
|
@ -673,8 +678,8 @@ tb_uid_t metaCtbCursorNext(SMCtbCursor *pCtbCur) {
|
|||
tb_uid_t id = *(tb_uid_t *)pkey.data;
|
||||
assert(id != 0);
|
||||
return id;
|
||||
// metaDecodeTbInfo(pBuf, &tbCfg);
|
||||
// return tbCfg.;
|
||||
// metaDecodeTbInfo(pBuf, &tbCfg);
|
||||
// return tbCfg.;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue