fix: if block row num is less than definit min rows, set the bucket index to 0

This commit is contained in:
shenglian zhou 2023-05-29 10:45:26 +08:00
parent 70c18d44a2
commit 43c0656df2
1 changed files with 3 additions and 0 deletions

View File

@ -5242,6 +5242,9 @@ int32_t tsdbReaderReset(STsdbReader* pReader, SQueryTableDataCond* pCond) {
}
static int32_t getBucketIndex(int32_t startRow, int32_t bucketRange, int32_t numOfRows, int32_t numOfBucket) {
if (numOfRows < startRow) {
return 0;
}
int32_t bucketIndex = ((numOfRows - startRow) / bucketRange);
if (bucketIndex == numOfBucket) {
bucketIndex -= 1;