fix(query):set correct block load condition.

This commit is contained in:
Haojun Liao 2022-09-15 17:44:28 +08:00
parent 8e62ebab64
commit 0c71d95773
1 changed files with 4 additions and 2 deletions

View File

@ -2096,8 +2096,10 @@ static int32_t buildComposedDataBlock(STsdbReader* pReader) {
// it is a clean block, load it directly
if (isCleanFileDataBlock(pReader, pBlockInfo, pBlock, pBlockScanInfo, keyInBuf, pLastBlockReader)) {
copyBlockDataToSDataBlock(pReader, pBlockScanInfo);
goto _end;
if (pReader->order == TSDB_ORDER_ASC || (pReader->order == TSDB_ORDER_DESC && (!hasDataInLastBlock(pLastBlockReader)))) {
copyBlockDataToSDataBlock(pReader, pBlockScanInfo);
goto _end;
}
}
} else { // file blocks not exist
pBlockScanInfo = pReader->status.pTableIter;