fix compile error
This commit is contained in:
parent
a929aa22d8
commit
75577937be
|
@ -477,154 +477,6 @@ int32_t mndDropIdxsByDb(SMnode *pMnode, STrans *pTrans, SDbObj *pDb) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static int32_t mndGetIdx(SMnode *pMnode, SUserIndexReq *indexReq, SUserIndexRsp *rsp, bool *exist) {
|
|
||||||
int32_t code = -1;
|
|
||||||
SSmaObj *pSma = NULL;
|
|
||||||
|
|
||||||
pSma = mndAcquireIdx(pMnode, indexReq->indexFName);
|
|
||||||
if (pSma == NULL) {
|
|
||||||
*exist = false;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(rsp->dbFName, pSma->db, sizeof(pSma->db));
|
|
||||||
memcpy(rsp->tblFName, pSma->stb, sizeof(pSma->stb));
|
|
||||||
strcpy(rsp->indexType, TSDB_INDEX_TYPE_SMA);
|
|
||||||
|
|
||||||
SNodeList *pList = NULL;
|
|
||||||
int32_t extOffset = 0;
|
|
||||||
code = nodesStringToList(pSma->expr, &pList);
|
|
||||||
if (0 == code) {
|
|
||||||
SNode *node = NULL;
|
|
||||||
FOREACH(node, pList) {
|
|
||||||
SFunctionNode *pFunc = (SFunctionNode *)node;
|
|
||||||
extOffset += snprintf(rsp->indexExts + extOffset, sizeof(rsp->indexExts) - extOffset - 1, "%s%s",
|
|
||||||
(extOffset ? "," : ""), pFunc->functionName);
|
|
||||||
}
|
|
||||||
|
|
||||||
*exist = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
mndReleaseIdx(pMnode, pSma);
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*int32_t mndGetTableIdx(SMnode *pMnode, char *tbFName, STableIndexRsp *rsp, bool *exist) {
|
|
||||||
int32_t code = 0;
|
|
||||||
SSmaObj *pSma = NULL;
|
|
||||||
SSdb *pSdb = pMnode->pSdb;
|
|
||||||
void *pIter = NULL;
|
|
||||||
STableIndexInfo info;
|
|
||||||
|
|
||||||
SStbObj *pStb = mndAcquireStb(pMnode, tbFName);
|
|
||||||
if (NULL == pStb) {
|
|
||||||
*exist = false;
|
|
||||||
return TSDB_CODE_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
strcpy(rsp->dbFName, pStb->db);
|
|
||||||
strcpy(rsp->tbName, pStb->name + strlen(pStb->db) + 1);
|
|
||||||
rsp->suid = pStb->uid;
|
|
||||||
rsp->version = pStb->smaVer;
|
|
||||||
mndReleaseStb(pMnode, pStb);
|
|
||||||
|
|
||||||
while (1) {
|
|
||||||
pIter = sdbFetch(pSdb, SDB_SMA, pIter, (void **)&pSma);
|
|
||||||
if (pIter == NULL) break;
|
|
||||||
|
|
||||||
if (pSma->stb[0] != tbFName[0] || strcmp(pSma->stb, tbFName)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
info.intervalUnit = pSma->intervalUnit;
|
|
||||||
info.slidingUnit = pSma->slidingUnit;
|
|
||||||
info.interval = pSma->interval;
|
|
||||||
info.offset = pSma->offset;
|
|
||||||
info.sliding = pSma->sliding;
|
|
||||||
info.dstTbUid = pSma->dstTbUid;
|
|
||||||
info.dstVgId = pSma->dstVgId;
|
|
||||||
|
|
||||||
SVgObj *pVg = mndAcquireVgroup(pMnode, pSma->dstVgId);
|
|
||||||
if (pVg == NULL) {
|
|
||||||
code = -1;
|
|
||||||
sdbRelease(pSdb, pSma);
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
info.epSet = mndGetVgroupEpset(pMnode, pVg);
|
|
||||||
|
|
||||||
info.expr = taosMemoryMalloc(pSma->exprLen + 1);
|
|
||||||
if (info.expr == NULL) {
|
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
code = -1;
|
|
||||||
sdbRelease(pSdb, pSma);
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(info.expr, pSma->expr, pSma->exprLen);
|
|
||||||
info.expr[pSma->exprLen] = 0;
|
|
||||||
|
|
||||||
if (NULL == taosArrayPush(rsp->pIndex, &info)) {
|
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
code = -1;
|
|
||||||
taosMemoryFree(info.expr);
|
|
||||||
sdbRelease(pSdb, pSma);
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
*exist = true;
|
|
||||||
|
|
||||||
sdbRelease(pSdb, pSma);
|
|
||||||
}
|
|
||||||
|
|
||||||
return code;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*static int32_t mndProcessGetIdxReq(SRpcMsg *pReq) {
|
|
||||||
SUserIndexReq indexReq = {0};
|
|
||||||
SMnode *pMnode = pReq->info.node;
|
|
||||||
int32_t code = -1;
|
|
||||||
SUserIndexRsp rsp = {0};
|
|
||||||
bool exist = false;
|
|
||||||
|
|
||||||
if (tDeserializeSUserIndexReq(pReq->pCont, pReq->contLen, &indexReq) != 0) {
|
|
||||||
terrno = TSDB_CODE_INVALID_MSG;
|
|
||||||
goto _OVER;
|
|
||||||
}
|
|
||||||
|
|
||||||
code = mndGetIdx(pMnode, &indexReq, &rsp, &exist);
|
|
||||||
if (code) {
|
|
||||||
goto _OVER;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!exist) {
|
|
||||||
// TODO GET INDEX FROM FULLTEXT
|
|
||||||
code = -1;
|
|
||||||
terrno = TSDB_CODE_MND_DB_INDEX_NOT_EXIST;
|
|
||||||
} else {
|
|
||||||
int32_t contLen = tSerializeSUserIndexRsp(NULL, 0, &rsp);
|
|
||||||
void *pRsp = rpcMallocCont(contLen);
|
|
||||||
if (pRsp == NULL) {
|
|
||||||
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
|
||||||
code = -1;
|
|
||||||
goto _OVER;
|
|
||||||
}
|
|
||||||
|
|
||||||
tSerializeSUserIndexRsp(pRsp, contLen, &rsp);
|
|
||||||
|
|
||||||
pReq->info.rsp = pRsp;
|
|
||||||
pReq->info.rspLen = contLen;
|
|
||||||
|
|
||||||
code = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
_OVER:
|
|
||||||
if (code != 0) {
|
|
||||||
mError("failed to get index %s since %s", indexReq.indexFName, terrstr());
|
|
||||||
}
|
|
||||||
|
|
||||||
return code;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
static int32_t mndProcessGetTbIdxReq(SRpcMsg *pReq) {
|
static int32_t mndProcessGetTbIdxReq(SRpcMsg *pReq) {
|
||||||
//
|
//
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue