Merge pull request #17229 from taosdata/fix/TD-19385

fix(query): fix inconsistent max value caused by data conversion when reading from sma.
This commit is contained in:
Shengliang Guan 2022-10-09 13:34:28 +08:00 committed by GitHub
commit 49a32709a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -1251,12 +1251,12 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
}
}
} else if (type == TSDB_DATA_TYPE_FLOAT) {
double prev = 0;
GET_TYPED_DATA(prev, double, type, &pBuf->v);
float prev = 0;
GET_TYPED_DATA(prev, float, type, &pBuf->v);
double val = GET_DOUBLE_VAL(tval);
float val = GET_DOUBLE_VAL(tval);
if ((prev < val) ^ isMinFunc) {
*(double*)&pBuf->v = val;
*(float*)&pBuf->v = val;
}
if (pCtx->subsidiaries.num > 0) {