fix assert in builtims.c

This commit is contained in:
Ganlin Zhao 2022-12-30 10:50:40 +08:00
parent 85eba36190
commit 763f702fff
1 changed files with 5 additions and 2 deletions

View File

@ -1009,7 +1009,10 @@ static bool validateHistogramBinDesc(char* binDescStr, int8_t binType, char* err
intervals[0] = -INFINITY; intervals[0] = -INFINITY;
intervals[numOfBins - 1] = INFINITY; intervals[numOfBins - 1] = INFINITY;
// in case of desc bin orders, -inf/inf should be swapped // in case of desc bin orders, -inf/inf should be swapped
ASSERT(numOfBins >= 4); if (numOfBins < 4) {
return false;
}
if (intervals[1] > intervals[numOfBins - 2]) { if (intervals[1] > intervals[numOfBins - 2]) {
TSWAP(intervals[0], intervals[numOfBins - 1]); TSWAP(intervals[0], intervals[numOfBins - 1]);
} }
@ -1354,7 +1357,7 @@ static int32_t translateCsum(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
} else if (IS_FLOAT_TYPE(colType)) { } else if (IS_FLOAT_TYPE(colType)) {
resType = TSDB_DATA_TYPE_DOUBLE; resType = TSDB_DATA_TYPE_DOUBLE;
} else { } else {
ASSERT(0); return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
} }
} }