feat(query): avg function check range overflow
This commit is contained in:
parent
3fb64bf078
commit
ba31ce8070
|
@ -553,7 +553,6 @@ int32_t avgFunction(SqlFunctionCtx* pCtx) {
|
||||||
} else {
|
} else {
|
||||||
for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; ++i) {
|
for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; ++i) {
|
||||||
if (type == TSDB_DATA_TYPE_TINYINT) {
|
if (type == TSDB_DATA_TYPE_TINYINT) {
|
||||||
pAvgRes->sum.isum += plist[i];
|
|
||||||
CHECK_OVERFLOW_SUM_SIGNED(pAvgRes, plist[i])
|
CHECK_OVERFLOW_SUM_SIGNED(pAvgRes, plist[i])
|
||||||
} else {
|
} else {
|
||||||
CHECK_OVERFLOW_SUM_UNSIGNED(pAvgRes, (uint8_t)plist[i])
|
CHECK_OVERFLOW_SUM_UNSIGNED(pAvgRes, (uint8_t)plist[i])
|
||||||
|
|
Loading…
Reference in New Issue