You need to sign in or sign up before continuing.
未验证 提交 093b3e80 编写于 作者: W wade zhang 提交者: GitHub

Merge pull request #17036 from taosdata/fix/TD-18385

fix(query): fix incorrect result for max(float)
...@@ -1558,7 +1558,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) { ...@@ -1558,7 +1558,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
} }
} else if (type == TSDB_DATA_TYPE_FLOAT) { } else if (type == TSDB_DATA_TYPE_FLOAT) {
float* pData = (float*)pCol->pData; float* pData = (float*)pCol->pData;
double* val = (double*)&pBuf->v; float* val = (float*)&pBuf->v;
for (int32_t i = start; i < start + numOfRows; ++i) { for (int32_t i = start; i < start + numOfRows; ++i) {
if ((pCol->hasNull) && colDataIsNull_f(pCol->nullbitmap, i)) { if ((pCol->hasNull) && colDataIsNull_f(pCol->nullbitmap, i)) {
...@@ -1625,7 +1625,7 @@ int32_t minmaxFunctionFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { ...@@ -1625,7 +1625,7 @@ int32_t minmaxFunctionFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
pEntryInfo->isNullRes = (pEntryInfo->numOfRes == 0) ? 1 : 0; pEntryInfo->isNullRes = (pEntryInfo->numOfRes == 0) ? 1 : 0;
if (pCol->info.type == TSDB_DATA_TYPE_FLOAT) { if (pCol->info.type == TSDB_DATA_TYPE_FLOAT) {
float v = *(double*)&pRes->v; float v = *(float*)&pRes->v;
colDataAppend(pCol, currentRow, (const char*)&v, pEntryInfo->isNullRes); colDataAppend(pCol, currentRow, (const char*)&v, pEntryInfo->isNullRes);
} else { } else {
colDataAppend(pCol, currentRow, (const char*)&pRes->v, pEntryInfo->isNullRes); colDataAppend(pCol, currentRow, (const char*)&pRes->v, pEntryInfo->isNullRes);
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
...@@ -337,6 +337,8 @@ python3 ./test.py -f 7-tmq/dataFromTsdbNWal-multiCtb.py ...@@ -337,6 +337,8 @@ python3 ./test.py -f 7-tmq/dataFromTsdbNWal-multiCtb.py
python3 ./test.py -f 7-tmq/tmq_taosx.py python3 ./test.py -f 7-tmq/tmq_taosx.py
python3 ./test.py -f 7-tmq/stbTagFilter-multiCtb.py python3 ./test.py -f 7-tmq/stbTagFilter-multiCtb.py
python3 ./test.py -f 99-TDcase/TD-19201.py
#------------querPolicy 2----------- #------------querPolicy 2-----------
python3 ./test.py -f 2-query/between.py -Q 2 python3 ./test.py -f 2-query/between.py -Q 2
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册