Merge pull request #26319 from taosdata/fix/check_end_pos

fix(tsdb):check the result of the binary search for the end position
This commit is contained in:
Haojun Liao 2024-06-27 17:32:32 +08:00 committed by GitHub
commit 72b892507c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -927,6 +927,10 @@ static int32_t getEndPosInDataBlock(STsdbReader* pReader, SBlockData* pBlockData
} else {
int64_t key = asc ? pReader->info.window.ekey : pReader->info.window.skey;
endPos = doBinarySearchKey(pBlockData->aTSKEY, pRecord->numRow, pos, key, pReader->info.order);
if (endPos == -1) {
return endPos;
}
endPos = findFirstPos(pBlockData->aTSKEY, pRecord->numRow, endPos, asc);
}