Merge pull request #14890 from taosdata/fix/TD-17356
fix:filter child table with tag
This commit is contained in:
commit
e0ec9687c5
|
@ -307,7 +307,6 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
|
||||||
SNode* pTagIndexCond = (SNode*)pListInfo->pTagIndexCond;
|
SNode* pTagIndexCond = (SNode*)pListInfo->pTagIndexCond;
|
||||||
if (pScanNode->tableType == TSDB_SUPER_TABLE) {
|
if (pScanNode->tableType == TSDB_SUPER_TABLE) {
|
||||||
if (pTagIndexCond) {
|
if (pTagIndexCond) {
|
||||||
///<<<<<<< HEAD
|
|
||||||
SIndexMetaArg metaArg = {
|
SIndexMetaArg metaArg = {
|
||||||
.metaEx = metaHandle, .idx = tsdbGetIdx(metaHandle), .ivtIdx = tsdbGetIvtIdx(metaHandle), .suid = tableUid};
|
.metaEx = metaHandle, .idx = tsdbGetIdx(metaHandle), .ivtIdx = tsdbGetIvtIdx(metaHandle), .suid = tableUid};
|
||||||
|
|
||||||
|
@ -315,20 +314,9 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
|
||||||
SIdxFltStatus status = SFLT_NOT_INDEX;
|
SIdxFltStatus status = SFLT_NOT_INDEX;
|
||||||
code = doFilterTag(pTagIndexCond, &metaArg, res, &status);
|
code = doFilterTag(pTagIndexCond, &metaArg, res, &status);
|
||||||
if (code != 0 || status == SFLT_NOT_INDEX) {
|
if (code != 0 || status == SFLT_NOT_INDEX) {
|
||||||
code = TSDB_CODE_INDEX_REBUILDING;
|
qError("failed to get tableIds from index, reason:%s, suid:%" PRIu64, tstrerror(code), tableUid);
|
||||||
}
|
// code = TSDB_CODE_INDEX_REBUILDING;
|
||||||
//=======
|
|
||||||
// SArray* res = taosArrayInit(8, sizeof(uint64_t));
|
|
||||||
// // code = doFilterTag(pTagIndexCond, &metaArg, res);
|
|
||||||
// code = TSDB_CODE_INDEX_REBUILDING;
|
|
||||||
//>>>>>>> dvv
|
|
||||||
if (code == TSDB_CODE_INDEX_REBUILDING) {
|
|
||||||
code = vnodeGetAllTableList(pVnode, tableUid, pListInfo->pTableList);
|
code = vnodeGetAllTableList(pVnode, tableUid, pListInfo->pTableList);
|
||||||
} else if (code != TSDB_CODE_SUCCESS) {
|
|
||||||
qError("failed to get tableIds, reason:%s, suid:%" PRIu64, tstrerror(code), tableUid);
|
|
||||||
taosArrayDestroy(res);
|
|
||||||
terrno = code;
|
|
||||||
return code;
|
|
||||||
} else {
|
} else {
|
||||||
qDebug("success to get tableIds, size:%d, suid:%" PRIu64, (int)taosArrayGetSize(res), tableUid);
|
qDebug("success to get tableIds, size:%d, suid:%" PRIu64, (int)taosArrayGetSize(res), tableUid);
|
||||||
}
|
}
|
||||||
|
@ -347,6 +335,10 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
|
||||||
terrno = code;
|
terrno = code;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
} else { // Create one table group.
|
||||||
|
STableKeyInfo info = {.lastKey = 0, .uid = tableUid, .groupId = 0};
|
||||||
|
taosArrayPush(pListInfo->pTableList, &info);
|
||||||
|
}
|
||||||
|
|
||||||
if (pTagCond) {
|
if (pTagCond) {
|
||||||
int32_t i = 0;
|
int32_t i = 0;
|
||||||
|
@ -361,10 +353,6 @@ int32_t getTableList(void* metaHandle, void* pVnode, SScanPhysiNode* pScanNode,
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { // Create one table group.
|
|
||||||
STableKeyInfo info = {.lastKey = 0, .uid = tableUid, .groupId = 0};
|
|
||||||
taosArrayPush(pListInfo->pTableList, &info);
|
|
||||||
}
|
|
||||||
|
|
||||||
pListInfo->pGroupList = taosArrayInit(4, POINTER_BYTES);
|
pListInfo->pGroupList = taosArrayInit(4, POINTER_BYTES);
|
||||||
if (pListInfo->pGroupList == NULL) {
|
if (pListInfo->pGroupList == NULL) {
|
||||||
|
|
Loading…
Reference in New Issue