Merge pull request #21510 from taosdata/szhou/fix-ts3461

fix: if block row num is less than definit min rows, set the bucket index to 0
This commit is contained in:
dapan1121 2023-05-30 08:51:24 +08:00 committed by GitHub
commit 2d6859d5d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -5244,6 +5244,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;