enh: opt tbname in
This commit is contained in:
parent
1286f7473c
commit
5b4d0eaabe
|
@ -111,22 +111,23 @@ SSchemaWrapper* metaGetTableSchema(SMeta* pMeta, tb_uid_t uid, int32_t sver, boo
|
|||
STSchema* metaGetTbTSchema(SMeta* pMeta, tb_uid_t uid, int32_t sver);
|
||||
int32_t metaGetTbTSchemaEx(SMeta* pMeta, tb_uid_t suid, tb_uid_t uid, int32_t sver, STSchema** ppTSchema);
|
||||
int metaGetTableEntryByName(SMetaReader* pReader, const char* name);
|
||||
tb_uid_t metaGetTableEntryUidByName(SMeta* pMeta, const char* name);
|
||||
int64_t metaGetTbNum(SMeta* pMeta);
|
||||
int64_t metaGetTimeSeriesNum(SMeta* pMeta);
|
||||
SMCtbCursor* metaOpenCtbCursor(SMeta* pMeta, tb_uid_t uid);
|
||||
void metaCloseCtbCursor(SMCtbCursor* pCtbCur);
|
||||
tb_uid_t metaCtbCursorNext(SMCtbCursor* pCtbCur);
|
||||
SMStbCursor* metaOpenStbCursor(SMeta* pMeta, tb_uid_t uid);
|
||||
void metaCloseStbCursor(SMStbCursor* pStbCur);
|
||||
tb_uid_t metaStbCursorNext(SMStbCursor* pStbCur);
|
||||
STSma* metaGetSmaInfoByIndex(SMeta* pMeta, int64_t indexUid);
|
||||
STSmaWrapper* metaGetSmaInfoByTable(SMeta* pMeta, tb_uid_t uid, bool deepCopy);
|
||||
SArray* metaGetSmaIdsByTable(SMeta* pMeta, tb_uid_t uid);
|
||||
SArray* metaGetSmaTbUids(SMeta* pMeta);
|
||||
void* metaGetIdx(SMeta* pMeta);
|
||||
void* metaGetIvtIdx(SMeta* pMeta);
|
||||
int metaTtlSmaller(SMeta* pMeta, uint64_t time, SArray* uidList);
|
||||
|
||||
tb_uid_t metaGetTableEntryUidByName(SMeta* pMeta, const char* name);
|
||||
int64_t metaGetTbNum(SMeta* pMeta);
|
||||
int64_t metaGetTimeSeriesNum(SMeta* pMeta);
|
||||
SMCtbCursor* metaOpenCtbCursor(SMeta* pMeta, tb_uid_t uid);
|
||||
void metaCloseCtbCursor(SMCtbCursor* pCtbCur);
|
||||
tb_uid_t metaCtbCursorNext(SMCtbCursor* pCtbCur);
|
||||
SMStbCursor* metaOpenStbCursor(SMeta* pMeta, tb_uid_t uid);
|
||||
void metaCloseStbCursor(SMStbCursor* pStbCur);
|
||||
tb_uid_t metaStbCursorNext(SMStbCursor* pStbCur);
|
||||
STSma* metaGetSmaInfoByIndex(SMeta* pMeta, int64_t indexUid);
|
||||
STSmaWrapper* metaGetSmaInfoByTable(SMeta* pMeta, tb_uid_t uid, bool deepCopy);
|
||||
SArray* metaGetSmaIdsByTable(SMeta* pMeta, tb_uid_t uid);
|
||||
SArray* metaGetSmaTbUids(SMeta* pMeta);
|
||||
void* metaGetIdx(SMeta* pMeta);
|
||||
void* metaGetIvtIdx(SMeta* pMeta);
|
||||
int metaTtlSmaller(SMeta* pMeta, uint64_t time, SArray* uidList);
|
||||
|
||||
int32_t metaCreateTSma(SMeta* pMeta, int64_t version, SSmaCfg* pCfg);
|
||||
int32_t metaDropTSma(SMeta* pMeta, int64_t indexUid);
|
||||
|
@ -184,8 +185,9 @@ int32_t tqProcessTaskRecoverRsp(STQ* pTq, SRpcMsg* pMsg);
|
|||
int32_t tqProcessTaskRetrieveReq(STQ* pTq, SRpcMsg* pMsg);
|
||||
int32_t tqProcessTaskRetrieveRsp(STQ* pTq, SRpcMsg* pMsg);
|
||||
|
||||
SSubmitReq* tqBlockToSubmit(SVnode* pVnode, const SArray* pBlocks, const STSchema* pSchema, SSchemaWrapper* pTagSchemaWrapper, bool createTb, int64_t suid,
|
||||
const char* stbFullName, SBatchDeleteReq* pDeleteReq);
|
||||
SSubmitReq* tqBlockToSubmit(SVnode* pVnode, const SArray* pBlocks, const STSchema* pSchema,
|
||||
SSchemaWrapper* pTagSchemaWrapper, bool createTb, int64_t suid, const char* stbFullName,
|
||||
SBatchDeleteReq* pDeleteReq);
|
||||
|
||||
// sma
|
||||
int32_t smaInit();
|
||||
|
|
|
@ -206,13 +206,18 @@ int metaGetTableUidByName(void *meta, char *tbName, uint64_t *uid) {
|
|||
int code = 0;
|
||||
SMetaReader mr = {0};
|
||||
metaReaderInit(&mr, (SMeta *)meta, 0);
|
||||
code = metaGetTableEntryByName(&mr, tbName);
|
||||
if (code < 0) {
|
||||
|
||||
SMeta *pMeta = mr.pMeta;
|
||||
SMetaReader *pReader = &mr;
|
||||
|
||||
// query name.idx
|
||||
if (tdbTbGet(pMeta->pNameIdx, tbName, strlen(tbName) + 1, &pReader->pBuf, &pReader->szBuf) < 0) {
|
||||
terrno = TSDB_CODE_PAR_TABLE_NOT_EXIST;
|
||||
metaReaderClear(&mr);
|
||||
return -1;
|
||||
}
|
||||
*uid = mr.me.uid;
|
||||
|
||||
*uid = *(tb_uid_t *)pReader->pBuf;
|
||||
metaReaderClear(&mr);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -418,6 +418,8 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, uint64_t suid, SArray
|
|||
terrno = code;
|
||||
goto end;
|
||||
}
|
||||
} else {
|
||||
qInfo("succ to get table from meta, suid:%" PRIu64, suid);
|
||||
}
|
||||
|
||||
int32_t rows = taosArrayGetSize(uidList);
|
||||
|
@ -785,15 +787,13 @@ static int32_t optimizeTbnameInCond(void* metaHandle, int64_t suid, SArray* list
|
|||
if (metaGetTableUidByName(metaHandle, name, &uid) == 0) {
|
||||
taosArrayPush(list, &uid);
|
||||
} else {
|
||||
qWarn("failed to get tableIds from by table name: %s, reason: %s", name, tstrerror(terrno));
|
||||
terrno = 0;
|
||||
qError("failed to get tableIds from by table name: %s", name);
|
||||
taosArrayDestroy(pTbList);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
taosArrayDestroy(pTbList);
|
||||
}
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode, SNode* pTagCond, SNode* pTagIndexCond,
|
||||
STableListInfo* pListInfo) {
|
||||
|
|
Loading…
Reference in New Issue