fix: if block row num is less than definit min rows, set the bucket index to 0
This commit is contained in:
parent
70c18d44a2
commit
43c0656df2
|
@ -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) {
|
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);
|
int32_t bucketIndex = ((numOfRows - startRow) / bucketRange);
|
||||||
if (bucketIndex == numOfBucket) {
|
if (bucketIndex == numOfBucket) {
|
||||||
bucketIndex -= 1;
|
bucketIndex -= 1;
|
||||||
|
|
Loading…
Reference in New Issue