diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index d3d890f361..ded736690d 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -394,9 +394,10 @@ static int32_t getFileCompInfo(STsdbQueryHandle* pQueryHandle, int32_t* numOfBlo STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, i); SCompIdx* compIndex = &pQueryHandle->rhelper.pCompIdx[pCheckInfo->tableId.tid]; - if (compIndex->len == 0 || compIndex->numOfBlocks == 0) { // no data block in this file, try next file + if (compIndex->len == 0 || compIndex->numOfBlocks == 0 || + compIndex->uid != pCheckInfo->tableId.uid) { // no data block in this file, try next file pCheckInfo->numOfBlocks = 0; - continue;//no data blocks in the file belongs to pCheckInfo->pTable + continue; // no data blocks in the file belongs to pCheckInfo->pTable } else { if (pCheckInfo->compSize < compIndex->len) { assert(compIndex->len > 0);